fix(grid): correct calcPixelWidth for collapsed column groups to prevent header/cell misalignment on scroll#17074
Draft
fix(grid): correct calcPixelWidth for collapsed column groups to prevent header/cell misalignment on scroll#17074
Conversation
…17042) Co-authored-by: ivanvpetrov <110455887+ivanvpetrov@users.noreply.github.com> Agent-Logs-Url: https://github.com/IgniteUI/igniteui-angular/sessions/e6ba7d54-577e-4819-9082-1cbfc05e3381
Copilot
AI
changed the title
[WIP] Fix issue #17042
fix(grid): correct calcPixelWidth for collapsed column groups to prevent header/cell misalignment on scroll
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a collapsible column group is collapsed and child columns have explicit widths, horizontal scrolling causes standalone columns' headers and cells to misalign. The header virtual scroll uses
calcPixelWidthfrom the column group object; the cell virtual scroll usescalcPixelWidthfrom individual leaf columns. On collapse,setExpandCollapseState()updates children'shiddenstates but never invalidates the group's cachedcalcPixelWidth, leaving it stale (full expanded width). The resulting size cache mismatch grows with scroll distance.Changes
IgxColumnGroupComponent(column-group.component.ts) — OverridesetExpandCollapseState()to callcacheCalcWidth()immediately after children's hidden states are mutated, socalcPixelWidthreflects only visible children before the next change detection cycle:grid-collapsible-columns.spec.ts— Regression test asserting that after initial collapse, the group'scalcPixelWidthmatches the dynamicwidthgetter (sum of visible children only), not the full expanded width.grid-samples.spec.ts— NewCollapsibleGroupInitiallyCollapsedComponentfixture with[expanded]="false"and explicit child column widths.💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.