DataGrid - Fix lookup filter changing to "(All)" after searching twice in another column (T1284002)#32969
DataGrid - Fix lookup filter changing to "(All)" after searching twice in another column (T1284002)#32969markallenramirez wants to merge 4 commits intoDevExpress:26_1from
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an end-to-end regression test to ensure DataGrid filter row lookup selections are preserved when the user types into another column’s filter editor multiple times (T1284002).
Changes:
- Added
SelectBoxusage in the filter row functional TestCafe suite. - Added a new TestCafe test that selects a lookup filter value, types into a text filter twice, and asserts the lookup filter remains unchanged.
e2e/testcafe-devextreme/tests/dataGrid/common/filterRow/functional.ts
Outdated
Show resolved
Hide resolved
e2e/testcafe-devextreme/tests/dataGrid/common/filterRow/functional.ts
Outdated
Show resolved
Hide resolved
packages/devextreme/js/__internal/grids/grid_core/filter/m_filter_row.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Fixes a DataGrid filter row regression where a lookup filter editor could reset its displayed value to “(All)” after repeated searching in another column when syncLookupFilterValues is enabled.
Changes:
- Preserve the lookup filter editor’s currently selected item when refreshing the wrapped lookup
dataSource. - Add a TestCafe regression test covering the “search twice in another column” scenario (T1284002).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
packages/devextreme/js/__internal/grids/grid_core/filter/m_filter_row.ts |
Adjusts lookup filter editor update logic during syncLookupFilterValues dataSource refresh. |
e2e/testcafe-devextreme/tests/dataGrid/common/filterRow/functional.ts |
Adds an E2E regression test reproducing and validating the reported issue. |
| const { selectedItem, items = [] } = editor.option(); | ||
| const hasSelectedItem = items.some((item) => equalByValue(item, selectedItem)); | ||
| if (!hasSelectedItem) { | ||
| editor.option('items', [...items, selectedItem]); |
There was a problem hiding this comment.
selectedItem for SelectBox defaults to null (e.g., when the filter value is cleared / "(All)"), so this logic can append null/undefined into items. That can introduce an empty lookup entry (or trigger template/getter edge cases) and will also run on fullReload when no lookup value is selected. Please guard this block so it only mutates items when selectedItem is defined (non-null) and items is an array; otherwise skip updating items.
| const { selectedItem, items = [] } = editor.option(); | |
| const hasSelectedItem = items.some((item) => equalByValue(item, selectedItem)); | |
| if (!hasSelectedItem) { | |
| editor.option('items', [...items, selectedItem]); | |
| const { selectedItem, items } = editor.option(); | |
| if (isDefined(selectedItem) && Array.isArray(items)) { | |
| const hasSelectedItem = items.some((item) => equalByValue(item, selectedItem)); | |
| if (!hasSelectedItem) { | |
| editor.option('items', [...items, selectedItem]); | |
| } |
No description provided.