[v8] Filter not working if accessorFn returns null for any row
Describe the bug
Filtering a column defines like:
{
id: 'name',
header: 'Name',
accessorKey: 'name',
}
works, even if that column has null values.
Now when doing
{
id: 'name',
header: 'Name',
accessorFn: (row) => row.name !== 'ignore' ? row.name : null,
}
in this case filtering does not work anymore at all. So even not for the rows returning a value.
I can use this workaround:
{
id: 'name',
header: 'Name',
accessorFn: (row) => row.name !== 'ignore' ? row.name : '',
}
but this should not be needed I would say.
Your minimal, reproducible example
Steps to reproduce
See above.
Expected behavior
Rows with actual value to be filtered succesfully.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
macOS
react-table version
v8.5.1, v.8.5.2
TypeScript version
v4.7.4
Additional context
No response
Terms & Code of Conduct
- [X] I agree to follow this project's Code of Conduct
- [X] 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.
Another issue with the workaround mentioned (return '') is that sortUndefined: 1, won't work anymore.
I stumbled upon this as well. I went to check the tests to see what the correct behaviour is but there are no tests :/ I'm trying to find out where the exception for null is.
Fixed by #4441
Hello, even with this fix :
If the 1st value is null, globalFilter doesn't work.