You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
set globalFilterFn="contains" or any other function apart from "fuzzy"
Ensure that one of the columns with global filtering enabled contains null data.
Apply any global filter by searching in the search bar
The filter fails to work. In console, you can see an error saying below. 5filterFns.ts:25 Uncaught TypeError: Cannot read properties of null (reading 'toString') at Object.contains [as filterFn] (filterFns.ts:25:34) at memo.key (getFilteredRowModel.ts:118:37) at Object._getFilteredRowModel (utils.ts:158:14) at Object.getFilteredRowModel (Filters.ts:424:22) at Object.getPreGroupedRowModel (Grouping.ts:217:42) at getGroupedRowModel.ts:10:47 at Object._getGroupedRowModel (utils.ts:143:21) at Object.getGroupedRowModel (Grouping.ts:227:22) at Object.getPreSortedRowModel (Sorting.ts:367:41) at getSortedRowModel.ts:10:46
I debugged the code to find that there is no check present to check if the column data is null and to prevent it, const contains = (row, id, filterValue) => row.getValue(id).toString().toLowerCase().trim().includes(filterValue.toString().toLowerCase().trim());
Minimal, Reproducible Example - (Optional, but Recommended)
Do you intend to try to help solve this bug with your own PR?
None
Terms
I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
The text was updated successfully, but these errors were encountered:
material-react-table version
v1.5.7
react & react-dom versions
v18.2.0
Describe the bug and the steps to reproduce it
Steps to reproduce
globalFilterFn="contains"
or any other function apart from "fuzzy"The filter fails to work. In console, you can see an error saying below.
5filterFns.ts:25 Uncaught TypeError: Cannot read properties of null (reading 'toString') at Object.contains [as filterFn] (filterFns.ts:25:34) at memo.key (getFilteredRowModel.ts:118:37) at Object._getFilteredRowModel (utils.ts:158:14) at Object.getFilteredRowModel (Filters.ts:424:22) at Object.getPreGroupedRowModel (Grouping.ts:217:42) at getGroupedRowModel.ts:10:47 at Object._getGroupedRowModel (utils.ts:143:21) at Object.getGroupedRowModel (Grouping.ts:227:22) at Object.getPreSortedRowModel (Sorting.ts:367:41) at getSortedRowModel.ts:10:46
I debugged the code to find that there is no check present to check if the column data is null and to prevent it,
const contains = (row, id, filterValue) => row.getValue(id).toString().toLowerCase().trim().includes(filterValue.toString().toLowerCase().trim());
Minimal, Reproducible Example - (Optional, but Recommended)
https://codesandbox.io/s/material-react-table-grouping-global-fitler-issue-315-hmbn6u
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
None
Terms
The text was updated successfully, but these errors were encountered: