Skip to content

DataGrid - Fix lookup filter changing to "(All)" after searching twice in another column (T1284002)#32969

Open
markallenramirez wants to merge 4 commits intoDevExpress:26_1from
markallenramirez:bug_T1284002/26_1
Open

DataGrid - Fix lookup filter changing to "(All)" after searching twice in another column (T1284002)#32969
markallenramirez wants to merge 4 commits intoDevExpress:26_1from
markallenramirez:bug_T1284002/26_1

Conversation

@markallenramirez
Copy link
Contributor

No description provided.

@markallenramirez markallenramirez self-assigned this Mar 19, 2026
@markallenramirez markallenramirez requested a review from a team as a code owner March 19, 2026 07:52
Copilot AI review requested due to automatic review settings March 19, 2026 07:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SelectBox usage 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.

Copilot AI review requested due to automatic review settings March 23, 2026 11:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +772 to +775
const { selectedItem, items = [] } = editor.option();
const hasSelectedItem = items.some((item) => equalByValue(item, selectedItem));
if (!hasSelectedItem) {
editor.option('items', [...items, selectedItem]);
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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]);
}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants