Skip to content

fix(grid): correct calcPixelWidth for collapsed column groups to prevent header/cell misalignment on scroll#17074

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-issue-17042
Draft

fix(grid): correct calcPixelWidth for collapsed column groups to prevent header/cell misalignment on scroll#17074
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-issue-17042

Conversation

Copy link
Contributor

Copilot AI commented Mar 23, 2026

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 calcPixelWidth from the column group object; the cell virtual scroll uses calcPixelWidth from individual leaf columns. On collapse, setExpandCollapseState() updates children's hidden states but never invalidates the group's cached calcPixelWidth, leaving it stale (full expanded width). The resulting size cache mismatch grows with scroll distance.

Changes

  • IgxColumnGroupComponent (column-group.component.ts) — Override setExpandCollapseState() to call cacheCalcWidth() immediately after children's hidden states are mutated, so calcPixelWidth reflects only visible children before the next change detection cycle:
protected override setExpandCollapseState() {
    super.setExpandCollapseState();
    if (this.grid) {
        this.cacheCalcWidth();
    }
}
  • grid-collapsible-columns.spec.ts — Regression test asserting that after initial collapse, the group's calcPixelWidth matches the dynamic width getter (sum of visible children only), not the full expanded width.
  • grid-samples.spec.ts — New CollapsibleGroupInitiallyCollapsedComponent fixture 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.

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
Copilot AI requested a review from ivanvpetrov March 23, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants