kit icon indicating copy to clipboard operation
kit copied to clipboard

An error with CSP if you run `npm run check` during `npm run dev`

Open frederikhors opened this issue 1 year ago • 2 comments

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)

Screen Shot 2022-10-29 at 1 04 21 AM Screen Shot 2022-10-29 at 1 04 43 AM Screen Shot 2022-10-29 at 1 05 28 AM

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

  1. Open codesandbox link.
  2. 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.
  3. 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

  • [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.

frederikhors avatar Aug 28 '24 13:08 frederikhors

Can reproduce.

ZeroPie avatar Dec 24 '22 16:12 ZeroPie

a few years later -___-

LiMao00 avatar Jul 09 '24 02:07 LiMao00

a few years later -___-

feel free to pr

KevinVandy avatar Jul 09 '24 03:07 KevinVandy