table icon indicating copy to clipboard operation
table copied to clipboard

Toggle select all rows doesn't respect `canSelect()` condition

Open simcha90 opened this issue 1 year ago • 2 comments

TanStack Table version

8.13.2

Framework/Library version

17.0.2

Describe the bug and the steps to reproduce it

  1. When you click unselect all rows it unselect even disabled rows (that was set for enableRowSelection)

  2. Second issue that it shows that all rows selected checkbox as checked (but should show indeterminate state) even if disabled row is not selected:

image

But when disabled row selected and other rows - not selected, it shows correctly indeterminate checkbox

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

(Please use Footer Checkbox for demonstration)

https://codesandbox.io/p/devbox/loving-voice-7sqqp7?file=%2Fsrc%2Fmain.tsx%3A109%2C13

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

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.

simcha90 avatar Mar 07 '24 15:03 simcha90

I am also facing the same issue. @simcha90 - You may want to update the rowSelection state type to remove the eslint error showing on your codesandbox link. const [rowSelection, setRowSelection] = React.useState<RowSelectionState>({0: true})

vishwas0459 avatar Mar 07 '24 16:03 vishwas0459