Skip to content

fix(pivot): Add igxForTrackBy for pivot horizontal layout#17290

Open
mddragnev wants to merge 1 commit into
21.2.xfrom
mdragnev/fix-17264-21.2.x
Open

fix(pivot): Add igxForTrackBy for pivot horizontal layout#17290
mddragnev wants to merge 1 commit into
21.2.xfrom
mdragnev/fix-17264-21.2.x

Conversation

@mddragnev
Copy link
Copy Markdown
Member

@mddragnev mddragnev commented May 21, 2026

Closes #17264

Description

When using horizontal row layout, the igxGridFor directive bound to the grouped row dimension data was comparing items by object reference. The pivotGridHorizontalRowGrouping pipe always produces new array references via cloneArray, so after each contentSizeChange event triggered regroupTrigger to increment and the pipe to rerun, the differ considered all items changed, causing _applyChanges() to touch the DOM, which triggered the contentObserver, which fired contentSizeChange again — creating an infinite loop.

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 requested a review from MayaKirova May 21, 2026 15:14
Copilot AI review requested due to automatic review settings May 21, 2026 15:14
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

Fixes an infinite re-render loop in the Pivot Grid’s horizontal row layout by ensuring the virtual igxGridFor tracking for grouped row-dimension data is stable across pipe re-executions (which currently recreate array references).

Changes:

  • Added a trackHorizontalRowGroup trackBy function keyed by the group’s first record dataIndex.
  • Wired the trackBy function to the horizontal row-dimensions igxGridFor via [igxForTrackBy].
  • Imported IPivotGridRecord to strongly type the trackBy callback.

Reviewed changes

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

File Description
projects/igniteui-angular/grids/pivot-grid/src/pivot-grid.component.ts Adds a typed trackBy function for horizontal row group virtualization.
projects/igniteui-angular/grids/pivot-grid/src/pivot-grid.component.html Applies [igxForTrackBy] to the horizontal row grouping igxGridFor to prevent full re-diffing on regroup.

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