Skip to content

Fix: Cannot read properties of undefined (reading 'offsetHeight') (T1321478)#32692

Merged
ajivanyandev merged 6 commits intoDevExpress:25_2from
ajivanyandev:fix/undefined-element-offset
Mar 12, 2026
Merged

Fix: Cannot read properties of undefined (reading 'offsetHeight') (T1321478)#32692
ajivanyandev merged 6 commits intoDevExpress:25_2from
ajivanyandev:fix/undefined-element-offset

Conversation

@ajivanyandev
Copy link
Contributor

No description provided.

@ajivanyandev ajivanyandev self-assigned this Feb 25, 2026
@ajivanyandev ajivanyandev reopened this Feb 25, 2026
@ajivanyandev ajivanyandev marked this pull request as ready for review March 3, 2026 11:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a runtime crash in the internal animation positioning utilities when they are invoked with an empty renderer wrapper (e.g., when an element has been unmounted), which previously could attempt to read offsetHeight from undefined.

Changes:

  • Removed a forced reflow access (.offsetHeight) from resetPosition to prevent crashing on empty wrappers.
  • Added an early return in positionUtils.setup when the target element set is empty.
  • Added Jest coverage for the empty-wrapper scenarios in both resetPosition and positionUtils.setup.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/devextreme/js/__internal/common/core/animation/translator.ts Removes the offsetHeight read that could crash when the wrapper is empty.
packages/devextreme/js/__internal/common/core/animation/translator.test.ts Adds Jest tests asserting resetPosition doesn’t throw for empty/missing elements.
packages/devextreme/js/__internal/common/core/animation/m_position.ts Returns undefined early when positioning is requested for an empty element set.
packages/devextreme/js/__internal/common/core/animation/m_position.test.ts Adds Jest tests asserting setup returns undefined for empty/missing elements.

@ajivanyandev ajivanyandev merged commit e33e626 into DevExpress:25_2 Mar 12, 2026
158 of 160 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants