Skip to content

Toolbar: use transform-safe measurements for layout calculations (T1326396)#33236

Merged
EugeniyKiyashko merged 1 commit intoDevExpress:26_1from
EugeniyKiyashko:26_1_toolbar_in_popup_with_animation
Apr 14, 2026
Merged

Toolbar: use transform-safe measurements for layout calculations (T1326396)#33236
EugeniyKiyashko merged 1 commit intoDevExpress:26_1from
EugeniyKiyashko:26_1_toolbar_in_popup_with_animation

Conversation

@EugeniyKiyashko
Copy link
Copy Markdown
Contributor

No description provided.

@EugeniyKiyashko EugeniyKiyashko self-assigned this Apr 13, 2026
Copilot AI review requested due to automatic review settings April 13, 2026 11:35
@EugeniyKiyashko EugeniyKiyashko requested a review from a team as a code owner April 13, 2026 11:35
@EugeniyKiyashko EugeniyKiyashko force-pushed the 26_1_toolbar_in_popup_with_animation branch from d97cf8d to cbef766 Compare April 13, 2026 11:38
Copy link
Copy Markdown
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

This PR targets correct toolbar layout calculations when the toolbar’s parent is scaled via CSS transform, and adds a regression test for the reported issue (T1245421).

Changes:

  • Added a QUnit regression test validating that toolbar label max-width remains stable under transform: scale().
  • Updated toolbar label width measurement helper usage in ToolbarBase (and adjusted ESLint suppressions).
  • Removed an ESLint suppression near the timeout handle type declaration.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/devextreme/testing/tests/DevExpress.ui.widgets/toolbar.tests.js Adds a regression test to ensure label max-width calculations are not affected by parent transform scaling.
packages/devextreme/js/__internal/ui/toolbar/toolbar.base.ts Adjusts label width measurement helper usage and modifies ESLint suppression/annotations related to setTimeout and unsafe returns.
Comments suppressed due to low confidence (1)

packages/devextreme/js/__internal/ui/toolbar/toolbar.base.ts:316

  • getRealLabelWidth still relies on getBoundingRect(label).width, but getBoundingRect is implemented via element.getBoundingClientRect() (js/__internal/core/utils/m_position.ts:10-19), which is affected by CSS transforms like scale(). That can make toolbar label max-width calculations depend on transforms (the scenario covered by the new test) and also forces an @typescript-eslint/no-unsafe-return suppression because getBoundingRect is untyped. Consider switching this measurement to a transform-safe size helper (e.g., getOuterWidth/getWidth based on offsetWidth) and/or tightening getBoundingRect typings to avoid the lint disable.
  }

  _alignSectionLabels(

@EugeniyKiyashko EugeniyKiyashko changed the title Toolbar: use transform-safe measurements for layout calculations (T1245421) Toolbar: use transform-safe measurements for layout calculations (T1326396) Apr 14, 2026
@EugeniyKiyashko EugeniyKiyashko merged commit 7399d63 into DevExpress:26_1 Apr 14, 2026
143 of 151 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants