-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Table v8 expanding - incorrect state of parent checkbox when selecting subrows #4720
Comments
I haven't considered that maybe the demo itself could be not correct. It looks that it is it's definition of IndeterminateCheckbox doesn't handle more depths so it should be added || row.getIsAllSubRowsSelected() to mark correct checked state:
|
I still have trouble with this exact same problem, currently trying to implement this on a Vue project but it's not working. Here's my attempt: Everything seems to work except the sub title checkbox. Repro:
|
@aleksygoroszko When I apply your changes to the codesandbox demo, the checkboxes still don't work properly. Maybe this issue needs to be re-opened? |
Describe the bug
When selecting subrows the parent checkbox does not get correct state
Your minimal, reproducible example
https://codesandbox.io/s/github/tanstack/table/tree/main/examples/react/expanding
Steps to reproduce
The bug can be reproduced in official demo:
https://codesandbox.io/s/github/tanstack/table/tree/main/examples/react/expanding
How to reproduce:
Expand the row
Begin selecting subrows, the parent checkbox shows partial selection, which is correct
When selecting last subrow, the parent row is set as unchecked, but should be checked to mark that all subrows are selected.
Selecting/unselecting parent checkox selects/unselects all subrows correctly
Expected behavior
Selecting all subrows must mark parent checkbox as checked
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Windows, Chrome 110.0.5481.104
react-table version
8.7.9
TypeScript version
Additional context
No response
Terms & Code of Conduct
The text was updated successfully, but these errors were encountered: