Skip to content

Conversation

@johanrd
Copy link
Contributor

@johanrd johanrd commented Oct 10, 2025

When getComputedStyle().maxHeight returns an empty string (which can
happen during DOM transitions, animations, or certain CSS edge cases),
the existing check maxHeightStyle !== 'none' passes, but the
subsequent call to estimateElementHeight() fails its assertion because
empty string is falsy.

Add a truthiness check to prevent calling estimateElementHeight() with
an empty or falsy maxHeight value.

Fixes assertion: "You called estimateElementHeight without a fallbackHeight", even when estimateHeight was set:

You called estimateElement height without a fallbackHeight

  at assert$1 (assert.js:40:13)
  at estimateElementHeight (estimate-element-height.js:3:3)
  at StaticRadar._updateConstants (radar.js:340:36)
  at StaticRadar.update (radar.js:222:10)
  at radar.js:214:12
  at Array.execJob (index.js:30:7)
  at Scheduler.flush (index.js:92:11)
  at index.js:78:12
  at sentryWrapped (helpers.js:117:17)
  ```

  When getComputedStyle().maxHeight returns an empty string (which can
  happen during DOM transitions, animations, or certain CSS edge cases),
  the existing check `maxHeightStyle !== 'none'` passes, but the
  subsequent call to estimateElementHeight() fails its assertion because
  empty string is falsy.

  Add a truthiness check to prevent calling estimateElementHeight() with
  an empty or falsy maxHeight value.

  Fixes assertion: "You called estimateElementHeight without a fallbackHeight"
@johanrd johanrd marked this pull request as draft October 10, 2025 08:38
… You called estimateElement height without a fallbackHeight

    at assert$1 (assert.js:40:13)
    at estimateElementHeight (estimate-element-height.js:3:3)
    at StaticRadar._updateConstants (radar.js:340:36)
    at StaticRadar.update (radar.js:222:10)
    at radar.js:214:12
    at Array.execJob (index.js:30:7)
    at Scheduler.flush (index.js:92:11)
    at index.js:78:12
    at sentryWrapped (helpers.js:117:17)
@johanrd johanrd marked this pull request as ready for review October 15, 2025 11:01
@johanrd johanrd changed the title Fix assertion error when maxHeight is empty string Add defensive checks for cases where maxHeight is empty string Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant