Call markForCheck when filter chip is clicked#16972
Conversation
…m/IgniteUI/igniteui-angular into mtsvyatkova/filter-row-chip-click
|
Without prior state restoration, the bug is hard to reproduce because Angular's event binding on the chip click calls However, after |
|
There has been no recent activity and this PR has been marked inactive. |
|
@mtsvyatkova |
|
I initially left this as a draft so that someone with a better understanding of the grid's change detection could take a look. I now realize that this may have caused some confusion. I'm marking it as Ready for Review so it can be reviewed and/or discarded if the approach isn't the right one. |
There was a problem hiding this comment.
Pull request overview
Fixes a change-detection edge case in the grid filtering UI where clicking a filter chip may not render/open the filter row until a subsequent UI event occurs (issue #16903).
Changes:
- Calls
ChangeDetectorRef.markForCheck()at the end ofonChipClicked()in the grid filtering cell to ensure OnPush components get checked after the chip interaction. - Adds a regression test that reproduces the state-restore + filter-chip click scenario and asserts the filtering row is rendered.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
projects/igniteui-angular/grids/core/src/filtering/base/grid-filtering-cell.component.ts |
Marks the filtering cell view for check after chip click to ensure the filter row becomes visible/rendered under OnPush. |
projects/igniteui-angular/grids/core/src/state.directive.spec.ts |
Adds a regression spec covering filter state restore + chip click and DOM assertion for the filtering row. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Closes #16903
Additional information (check all that apply):
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)