From 3bf6c5c4e0ef57b2f92358336f1d293d8d05fa13 Mon Sep 17 00:00:00 2001 From: Mark Allen Ramirez Date: Thu, 12 Dec 2024 19:51:18 +0800 Subject: [PATCH] new fix --- .../__internal/grids/grid_core/filter/m_filter_sync.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/devextreme/js/__internal/grids/grid_core/filter/m_filter_sync.ts b/packages/devextreme/js/__internal/grids/grid_core/filter/m_filter_sync.ts index 48df0b766237..b42da82860c0 100644 --- a/packages/devextreme/js/__internal/grids/grid_core/filter/m_filter_sync.ts +++ b/packages/devextreme/js/__internal/grids/grid_core/filter/m_filter_sync.ts @@ -122,9 +122,13 @@ const updateFilterRowCondition = function (columnsController, column, condition) const filterValue = condition?.[2]; const filterOperations = column.filterOperations || column.defaultFilterOperations; - if ((!filterOperations || filterOperations.indexOf(selectedFilterOperation) >= 0 || selectedFilterOperation === column.defaultFilterOperation) - && FILTER_ROW_OPERATIONS.includes(selectedFilterOperation) && filterValue !== null) { - if (selectedFilterOperation === column.defaultFilterOperation && !isDefined(column.selectedFilterOperation)) { + const selectedOperationExists = filterOperations.indexOf(selectedFilterOperation) >= 0; + const defaultOperationSelected = selectedFilterOperation === column.defaultFilterOperation; + const builtInOperationSelected = FILTER_ROW_OPERATIONS.includes(selectedFilterOperation); + const filterValueNotNullOrEmpty = filterValue !== null && filterValue !== ''; + + if ((!filterOperations || selectedOperationExists || defaultOperationSelected) && builtInOperationSelected && filterValueNotNullOrEmpty) { + if (defaultOperationSelected && !isDefined(column.selectedFilterOperation)) { selectedFilterOperation = column.selectedFilterOperation; } filterRowOptions = {