Skip to content

fix(splitter): preserve pane sizes after collapse - #17553

Merged
kdinev merged 5 commits into
masterfrom
vkombov/fix-17545
Sep 8, 2026
Merged

fix(splitter): preserve pane sizes after collapse#17553
kdinev merged 5 commits into
masterfrom
vkombov/fix-17545

Conversation

@viktorkombov

@viktorkombov viktorkombov commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Closes #17545

Description

This PR prevents IgxSplitterPane from losing its configured size after being collapsed and expanded.

Previously, collapsing a pane reset its siblings to size="auto", which caused horizontal panes to lose their previous width. The updated behavior:

  • Preserves pane sizes and min/max constraints.
  • Clears only temporary drag sizes.
  • Allows fixed-size siblings to fill the released space while a pane is collapsed.
  • Handles both runtime and initially collapsed panes.

Testing

Added coverage for horizontal and vertical splitters, fixed-size panes, initial collapse, and temporary drag-size cleanup.

Motivation / Context

Type of Change (check all that apply):

  • Bug fix
  • New functionality
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes)
  • Documentation
  • Demos
  • CI/CD
  • Tests
  • Changelog
  • Skills/Agents

Component(s) / Area(s) Affected:

How Has This Been Tested?

  • Unit tests
  • Manual testing
  • Automated e2e tests

Test Configuration:

  • Angular version:
  • Browser(s):
  • OS:

Screenshots / Recordings

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them
  • Accessibility (ARIA, keyboard navigation, focus management) has been verified

@mddragnev mddragnev added ✅ status: verified Applies to PRs that have passed manual verification and removed ❌ status: awaiting-test PRs awaiting manual verification labels Sep 1, 2026
kdinev
kdinev previously approved these changes Sep 8, 2026
Copilot AI lite review requested due to automatic review settings September 8, 2026 11:30
@kdinev
kdinev enabled auto-merge (squash) September 8, 2026 11:30
@kdinev
kdinev disabled auto-merge September 8, 2026 11:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new unit tests rely on strict offsetWidth/offsetHeight equality, which is likely to be flaky due to rounding/layout differences across runs and environments.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the Splitter collapse/expand behavior so IgxSplitterPane preserves its configured sizes (and min/max constraints) instead of resetting sibling sizes to auto, addressing the “restore original size after expand” regression described in #17545.

Changes:

  • Removed the initialization-time size reset that triggered when any panes were collapsed.
  • Updated pane collapse handling to preserve size while clearing only temporary dragSize, and to allow adjacent fixed-size panes to flex-fill released space during a collapse.
  • Added/updated unit tests covering horizontal/vertical collapse/expand, fixed-size siblings, initially-collapsed panes, and drag-size cleanup.
File summaries
File Description
projects/igniteui-angular/splitter/src/splitter/splitter.component.ts Stops resetting pane sizes during pane initialization when a pane starts collapsed.
projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts Adds coverage for preserving sizes/constraints across collapse/expand, including fixed-size and initially-collapsed scenarios.
projects/igniteui-angular/splitter/src/splitter/splitter-pane/splitter-pane.component.ts Adjusts flex behavior to preserve configured sizes, clear only drag sizes on collapse changes, and allow fill behavior while a sibling is collapsed.
Review details

Suppressed comments (2)

projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts:551

  • Asserting exact pixel widths for all panes (toEqual([100, 100, 100])) may be brittle if splitter bars/borders/padding affect offsetWidth by a pixel. A tolerance-based assertion is typically more stable.
        expect(panes.map(pane => pane.element.offsetWidth)).toEqual([100, 100, 100]);

projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts:319

  • These strict offsetWidth equality assertions can be flaky due to rounding/layout differences after toggling collapse (even when the configured sizes are preserved). Consider asserting within a small pixel tolerance instead.
        expect(pane1.element.offsetWidth).toBe(pane1Width);
        expect(pane2.element.offsetWidth).toBe(pane2Width);
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts Outdated
Comment thread projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@kdinev
kdinev enabled auto-merge (squash) September 8, 2026 11:41
@kdinev
kdinev merged commit c5f6f3d into master Sep 8, 2026
6 checks passed
@kdinev
kdinev deleted the vkombov/fix-17545 branch September 8, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

splitter version: 22.2.x ✅ status: verified Applies to PRs that have passed manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After splitter panel resize and collapse, the panel does not restore to its original size on expand

4 participants