Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
simcha90 opened this issue Mar 7, 2024 · 1 comment
Open
2 tasks done

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

simcha90 opened this issue Mar 7, 2024 · 1 comment

Comments

@simcha90
Copy link

simcha90 commented Mar 7, 2024

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

  • 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.
@vishwas0459
Copy link

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})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants