Global Filter does not work, if one of your columns has null #5084
Replies: 2 comments 1 reply
-
Im having the same issue in my app, but when I try to recreate a simple example it works fine. https://codesandbox.io/p/devbox/epic-ride-forked-6j9dpl?file=%2Fsrc%2FApp.tsx%3A67%2C40
|
Beta Was this translation helpful? Give feedback.
-
For anyone stumbling across this problem: As stated in Global Filtering APIs | TanStack Table Docs (can-filter), if This can be verified in the source code: Therefore, a solution would be to overwrite const table = useReactTable({
...
getColumnCanGlobalFilter: function(){ /* add your logic here */ }
...
}) |
Beta Was this translation helpful? Give feedback.
-
If one of your columns contain null, the globalfilter does not work.
The only way to make it work, is to use map() and change every null to an empty string.
Is there maybe a way to tell react-table to transform nulls to empty strings or ignore them on globalfiltering, so to save some map() logic for every table that you are using?
Beta Was this translation helpful? Give feedback.
All reactions