T1331971: DataGrid - Filter Panel and Filter Row values are not synchronized when applyFilter="onClick" - #34404
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes DataGrid filter synchronization when filterRow.applyFilter = "onClick" by ensuring the Filter Row editor reflects the latest applied filterValue (e.g., from the Filter Panel) rather than keeping a stale buffered (pending) value.
Changes:
- Clear
bufferedFilterValue/bufferedSelectedFilterOperationduring filter sync so the Filter Row editor updates to the currently applied condition. - Minor cleanup/refactor in filter sync logic (remove
thatalias; simplify ternary assignments). - Add an integration test covering Filter Row editor updates after consecutive
filterValuechanges inonClickmode (T1331971).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/devextreme/js/__internal/grids/grid_core/filter/m_filter_sync.ts | Resets buffered Filter Row column options during sync so onClick mode editors don’t keep stale pending values. |
| packages/devextreme/js/__internal/grids/grid_core/filter/tests/m_filter_row.integration.test.ts | Adds a regression integration test asserting the Filter Row text editor updates after filter changes (T1331971). |
| filterRowOptions = { | ||
| filterValue, | ||
| selectedFilterOperation, | ||
| bufferedFilterValue: undefined, |
There was a problem hiding this comment.
Does it make sense to reset these properties here? They will be restored later in the editor handler anyway (at least bufferedFilterValue will be).
There was a problem hiding this comment.
it's actually necessary. The reset is what lets the editor read the freshly-synced filterValue during that same columnOption change; without it getColumnFilterValue returns the stale buffered value and the editor never updates - this is our bug. Yes, the editor handler re-writes bufferedFilterValue afterwards, but to the new filterValue and bufferedSelectedFilterOperation is not restored by that handler, so its reset is clearly needed. Actually the regression test covers this exact path
| }); | ||
|
|
||
| describe('sync with filter panel when applyFilter is onClick (T1331971)', () => { | ||
| it('should update the filter row editor when the condition is changed via the filter panel', async () => { |
There was a problem hiding this comment.
Let's add a test for filter reset.
ac441dc to
e30ea85
Compare
…ronized when applyFilter="onClick" (#34404)
What
DataGrid now keeps the filter row value in sync with the filter panel when
filterRow.applyFilterisonClickHow
The filter synchronization resets the buffered filter row value so the editor reflects the latest applied
filterValueinstead of a stale pending value