Skip to content

Splitter: size of panes should be updated taking into account their limitations on splitter resize#32862

Open
pharret31 wants to merge 2 commits intoDevExpress:26_1from
pharret31:26_1_3660-splitter-size-of-panes-should-be-updated-taking-into-account-their-limitations-on-splitter-resize
Open

Splitter: size of panes should be updated taking into account their limitations on splitter resize#32862
pharret31 wants to merge 2 commits intoDevExpress:26_1from
pharret31:26_1_3660-splitter-size-of-panes-should-be-updated-taking-into-account-their-limitations-on-splitter-resize

Conversation

@pharret31
Copy link
Contributor

No description provided.

@pharret31 pharret31 self-assigned this Mar 11, 2026
@pharret31 pharret31 added the 26_1 label Mar 11, 2026
@pharret31 pharret31 marked this pull request as ready for review March 11, 2026 10:07
@pharret31 pharret31 requested a review from a team as a code owner March 11, 2026 10:07
Copilot AI review requested due to automatic review settings March 11, 2026 10:07
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

Updates Splitter’s dimension-change handling so pane sizes/layout are recalculated in a way that respects pane constraints (min/max/fixed sizes) when the splitter is resized, and expands the QUnit coverage for these scenarios.

Changes:

  • Reorders _dimensionChanged() to recalculate layout, apply it to DOM, then update stored item sizes.
  • Updates an existing resizing test expectation to match the new constraint-aware behavior.
  • Adds a set of new tests validating that minSize/maxSize constraints are respected after splitter width changes.

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/splitter.tests.js Updates one existing resize test and adds new cases covering constraint enforcement after dimension changes.
packages/devextreme/js/__internal/ui/splitter/splitter.ts Changes dimension-change flow to apply the recalculated layout before persisting new pane sizes.

Comment on lines 1102 to +1106
_dimensionChanged(): void {
this._updateItemSizes();

this._layout = this._getDefaultLayoutBasedOnSize();
this._applyStylesFromLayout(this._layout);

this._updateItemSizes();
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

_dimensionChanged() now recalculates layout and applies flex styles before updating item sizes. If width/height is changed while the splitter is hidden or detached, getElementSize() can be 0 while _getResizeHandlesSize() is non-zero, which can produce negative ratios in convertSizeToRatio() and an invalid layout that then gets applied to the DOM. Consider guarding _dimensionChanged similarly to _resizeHandler/_renderItems (e.g., if not attached/visible, set _shouldRecalculateLayout = true and return without applying styles), so the layout is recalculated once the component becomes visible.

Copilot uses AI. Check for mistakes.
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.

2 participants