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
If the first row of a table has an undefined value in a column, the global filter won't work on that column, regardless of valid values in subsequent rows.
Take for example:
ID
Other
test
hello
test
world
test
Searching for hello with the global filter fails, even though it's clearly there. As soon as the order of the rows within the data is reversed, the global filters begins to work again.
Create a table where the first row of data has an undefined value. Subsequent rows should have string values. Upon using the global filter to search for an existing value, nothing is shown.
Expected behavior
Global filter should work, regardless of row order.
How often does this bug happen?
Every time
Screenshots or Videos
0247.mp4
Platform
OS: Windows
Browser: Firefox
react-table version
8.8.2
TypeScript version
No response
Additional context
This may be due to the default getColumnCanGlobalFilter implementation:
It seems to check the first row's values to determine if certain columns can be globally filtered.
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.
Describe the bug
If the first row of a table has an undefined value in a column, the global filter won't work on that column, regardless of valid values in subsequent rows.
Take for example:
Searching for hello with the global filter fails, even though it's clearly there. As soon as the order of the rows within the data is reversed, the global filters begins to work again.
Your minimal, reproducible example
https://codesandbox.io/p/sandbox/adoring-sid-ro5tmg?file=%2Fsrc%2Fmain.tsx&selection=%5B%7B%22endColumn%22%3A26%2C%22endLineNumber%22%3A56%2C%22startColumn%22%3A26%2C%22startLineNumber%22%3A56%7D%5D
Steps to reproduce
Create a table where the first row of data has an undefined value. Subsequent rows should have string values. Upon using the global filter to search for an existing value, nothing is shown.
Expected behavior
Global filter should work, regardless of row order.
How often does this bug happen?
Every time
Screenshots or Videos
0247.mp4
Platform
react-table version
8.8.2
TypeScript version
No response
Additional context
This may be due to the default getColumnCanGlobalFilter implementation:
table/packages/table-core/src/features/Filters.ts
Lines 190 to 196 in 134414e
It seems to check the first row's values to determine if certain columns can be globally filtered.
Terms & Code of Conduct