Skip to content

Commit

Permalink
fix cell value type in quick filtering v7
Browse files Browse the repository at this point in the history
  • Loading branch information
cherniavskii committed Nov 3, 2023
1 parent 83b9475 commit ecdef46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/grid/x-data-grid/src/colDef/gridStringOperators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ export const getGridStringOperators = (
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();

const filterRegex = new RegExp(escapeRegExp(filterItemValue), 'i');
return (value): boolean => {
return value != null ? filterRegex.test(String(value)) : false;
return (_, row, column, apiRef): boolean => {
const cellValue = apiRef.current.getRowFormattedValue(row, column);
return cellValue != null ? filterRegex.test(String(cellValue)) : false;
};
},
InputComponent: GridFilterInputValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ const buildAggregatedQuickFilterApplier = (
}

const applier = appliers[v];
let value = apiRef.current.getRowFormattedValue(row, column);
let value = apiRef.current.getRowValue(row, column);

if (applier.fn === null) {
continue;
Expand Down

0 comments on commit ecdef46

Please sign in to comment.