Skip to content

Commit fd37bcc

Browse files
committed
v5 compat
1 parent a972ed1 commit fd37bcc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/grid/x-data-grid/src/components/toolbar/GridToolbarFilterButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ const GridToolbarFilterButton = React.forwardRef<HTMLButtonElement, GridToolbarF
7777
.toString();
7878

7979
const getFilterItemValue = (item: GridFilterItem): string => {
80-
const { getValueAsString } = lookup[item.field!].filterOperators!.find(
81-
(operator) => operator.value === item.operator,
80+
const { getValueAsString } = lookup[item.columnField!].filterOperators!.find(
81+
(operator) => operator.value === item.operatorValue,
8282
)!;
8383

8484
return getValueAsString ? getValueAsString(item.value) : item.value;

packages/grid/x-data-grid/src/tests/filtering.DataGrid.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ describe('<DataGrid /> - Filter', () => {
11921192
<div style={{ width: '100%', height: '400px' }}>
11931193
<DataGrid
11941194
filterModel={{
1195-
items: [{ field: 'name', operator: 'contains', value: 'John' }],
1195+
items: [{ columnField: 'name', operatorValue: 'contains', value: 'John' }],
11961196
}}
11971197
rows={[
11981198
{
@@ -1215,9 +1215,9 @@ describe('<DataGrid /> - Filter', () => {
12151215
getApplyFilterFn: (filterItem) => {
12161216
return (params) => {
12171217
if (
1218-
!filterItem.field ||
1218+
!filterItem.columnField ||
12191219
!filterItem.value ||
1220-
!filterItem.operator ||
1220+
!filterItem.operatorValue ||
12211221
!params.value
12221222
) {
12231223
return null;

0 commit comments

Comments
 (0)