-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when global filter called for numeric columns #4210
Comments
While upgrading from 8.2.x to 8.3.3 I'm experiencing the same.
|
Just stumbled upon this and found a way around the error. const columns: ColumnDef<User>[] = [
columnHelper.accessor(row => row.id.toString(), {
id: 'id',
header: 'User ID'
}),
...
] |
@fabiendeborde i don't think using the accessor is the smartest way to do this. |
Does "2 tasks done" mean someone is working on a fix? |
@marceloverdijk I was worried about that too, but the default sorting is working just fine... |
@fabiendeborde Thanks for your work, you solved my problem! |
@tannerlinsley was there a fix for this? as with latest |
Yes I noticed this as well for some of my tables, that the sorting was working just fine as expected (sorting by number and not string). However it's a bit strange it's working like that to be honest --> as we explicitly converted to string... Now the funny part is I see this behaviour for all my tables except for just 1... Breaking my head on this one ;-) |
Thanks, helped me! |
We can use this too,
|
|
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 ontoLowerCase
). 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
Uncaught TypeError: _row$getValue.toLowerCase is not a function
in 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
The text was updated successfully, but these errors were encountered: