Describe the bug
As mentioned in title, rows are not filtered when table.setGlobalFilter(0).
It seems like rows get filtered only when globalFilter value is truthy. (found in line 19 and 69 in getFilteredRowModel.ts, also in getFacetedRowModel.ts)



I added fliterFn.autoRenew to always return false in order to prevent filter value being removed from the filter state, but it didn't work as well.
Your minimal, reproducible example
https://codesandbox.io/s/determined-ellis-td1g4l?file=/src/App.tsx
Steps to reproduce
- Open codesandbox link.
- In browser tab, choose an option from input(select) in following orders: "Complicated", "Single", and "Relationship". Selecting each option will update
globalFilter to 1, 2, and 0.
- When
globalFilter is set to 0, table.getFilteredRowModel() returns non-filtered rows.
Expected behavior
I would expect that globalFilter should also be applied when its value is 0.
value 0 is often used as some kind of "status" and it represents valid value as number.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
OS: macOS Monterey 12.2.1
Browser: Chrome v106.0.5249.103 (Official Build) (arm64)
Editor: VSCode Version: 1.72.1 (Universal)
React: v17.0.2
react-table version
v8.5.18
TypeScript version
v4.5.5
Additional context
No response
Terms & Code of Conduct
Describe the bug
As mentioned in title, rows are not filtered when
table.setGlobalFilter(0).It seems like rows get filtered only when
globalFiltervalue is truthy. (found in line 19 and 69 in getFilteredRowModel.ts, also in getFacetedRowModel.ts)I added fliterFn.autoRenew to always return false in order to prevent filter value being removed from the filter state, but it didn't work as well.
Your minimal, reproducible example
https://codesandbox.io/s/determined-ellis-td1g4l?file=/src/App.tsx
Steps to reproduce
globalFilterto1,2, and0.globalFilteris set to0,table.getFilteredRowModel()returns non-filtered rows.Expected behavior
I would expect that globalFilter should also be applied when its value is 0.
value 0 is often used as some kind of "status" and it represents valid value as number.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
OS: macOS Monterey 12.2.1
Browser: Chrome v106.0.5249.103 (Official Build) (arm64)
Editor: VSCode Version: 1.72.1 (Universal)
React: v17.0.2
react-table version
v8.5.18
TypeScript version
v4.5.5
Additional context
No response
Terms & Code of Conduct