Skip to content

Call markForCheck when filter chip is clicked#16972

Draft
mtsvyatkova wants to merge 6 commits intomasterfrom
mtsvyatkova/filter-row-chip-click
Draft

Call markForCheck when filter chip is clicked#16972
mtsvyatkova wants to merge 6 commits intomasterfrom
mtsvyatkova/filter-row-chip-click

Conversation

@mtsvyatkova
Copy link
Contributor

Closes #16903

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

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

@mtsvyatkova
Copy link
Contributor Author

Without prior state restoration, the bug is hard to reproduce because Angular's event binding on the chip click calls markForCheck() on the filter cell component, and the dirty flag propagation reaches the header row (I cannot reproduce it without the setState call).

However, after setState(), setStateInternal calls this.grid.cdr.detectChanges() synchronously (line 558 in state-base.directive.ts, marked with // TODO). This forces a full check of the grid subtree, clearing all OnPush dirty flags. After that, the event binding's markForCheck() starting from the filter cell no longer reliably reaches the header row, and isFilterRowVisible is never re-evaluated (line 112 in grid-header-row.component.html).

@mtsvyatkova mtsvyatkova changed the title Call notifyChanges when filter chip is clicked Call markForCheck when filter chip is clicked Feb 25, 2026
@gedinakova gedinakova requested a review from dkamburov February 25, 2026 14:31
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.

Grid Filter: change detection issue

1 participant