Skip to content

fix(pivotGrid): Fix error thrown opening date pivot dimension filter. - #17479

Merged
dkamburov merged 3 commits into
masterfrom
skrastev/fix-pivot-error
Aug 4, 2026
Merged

fix(pivotGrid): Fix error thrown opening date pivot dimension filter.#17479
dkamburov merged 3 commits into
masterfrom
skrastev/fix-pivot-error

Conversation

@skrustev

@skrustev skrustev commented Aug 3, 2026

Copy link
Copy Markdown
Member

Closes #17478

Description

Issue was cause due to conflicting Angular collections when triggering detect change while another happens.

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:

Pivot grid

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

@skrustev
skrustev requested a review from MayaKirova August 3, 2026 10:44
Copilot AI review requested due to automatic review settings August 3, 2026 10:44

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.

Pull request overview

Fixes an error in the Pivot Grid when opening a date pivot dimension filter by deferring column regeneration triggered by i18n resource changes, avoiding conflicting Angular change detection/collection updates.

Changes:

  • Defer setupColumns() execution in the i18n onResourceChange handler via a microtask (Promise.resolve().then(...)).

Copilot AI review requested due to automatic review settings August 3, 2026 11:05
@skrustev skrustev added the squash-merge Merge PR with "Squash and Merge" option label Aug 3, 2026

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (1)

projects/igniteui-angular/grids/pivot-grid/src/pivot-grid.spec.ts:846

  • getI18nManager is no longer used in this spec after removing the listener workaround, but the import remains. This leaves an unused import (and can fail lint/TS checks with no-unused-vars/noUnusedLocals). Remove the getI18nManager import from the top of the file.
                const pivotGrid = fixture.componentInstance.pivotGrid;
                expect(pivotGrid.filterStrategy).toBeInstanceOf(DimensionValuesFilteringStrategy);

Copilot AI review requested due to automatic review settings August 3, 2026 11:10

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (1)

projects/igniteui-angular/grids/pivot-grid/src/pivot-grid.component.ts:1003

  • The setupColumns() call is now deferred via Promise.resolve().then(...), but that microtask isn’t tied to destroy$. If the grid gets destroyed after the i18n onResourceChange callback runs (but before the microtask executes), this can invoke setupColumns() on a destroyed component and throw (the base grid sets _destroyed = true in ngOnDestroy). Guard the microtask with _destroyed (or an equivalent destroy check).
                Promise.resolve().then(() => {
                    this.setupColumns();
                });

@dkamburov dkamburov added ✅ status: verified Applies to PRs that have passed manual verification and removed ❌ status: awaiting-test PRs awaiting manual verification labels Aug 3, 2026
@dkamburov
dkamburov merged commit 9a1bfc8 into master Aug 4, 2026
7 checks passed
@dkamburov
dkamburov deleted the skrastev/fix-pivot-error branch August 4, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

grid: pivot squash-merge Merge PR with "Squash and Merge" option version: 22.1.x ✅ status: verified Applies to PRs that have passed manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Elements] Pivot Grid throwing error when opening the Pivot Date Dimension filter

4 participants