-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
Describe the bug
#4124 (fixed by a5578ac) makes the table now call the global filter functions for strings and numbers.
However, most of the built-in filter functions don't handle numbers, they assume the value is a string (https://github.com/TanStack/table/blob/main/packages/table-core/src/filterFns.ts)
This makes it very liable to break (e.g. auto filter does includesString, which breaks on toLowerCase). The workaround is easy - provide a custom filter function for numeric columns or exclude them from the filtering.
It would be nicer if the default filter functions handled numbers
Your minimal, reproducible example
https://nyxdj8.sse.codesandbox.io
Steps to reproduce
- Type "a" in the global filter
- See
Uncaught TypeError: _row$getValue.toLowerCase is not a functionin the console (filtering doesn't complete)
Expected behavior
The default filter functions should handle numbers by default
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
macOS, Chrome
react-table version
8.3.0
TypeScript version
4.6.3
Additional context
No response
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.