You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Table v8 expanding - incorrect state of parent checkbox when selecting subrows #4720
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
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.
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:
Activity
aleksygoroszko commentedon Feb 21, 2023
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:
<IndeterminateCheckbox {...{ checked: row.getIsSelected() || row.getIsAllSubRowsSelected(), indeterminate: row.getIsSomeSelected(), onChange: row.getToggleSelectedHandler(), }} />VincEnterprise commentedon Apr 5, 2023
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:
https://codesandbox.io/p/sandbox/amazing-panna-ksdmvb?file=%2Fsrc%2FApp.vue&selection=%5B%7B%22endColumn%22%3A13%2C%22endLineNumber%22%3A89%2C%22startColumn%22%3A13%2C%22startLineNumber%22%3A89%7D%5D
Everything seems to work except the sub title checkbox.
Repro:
VincEnterprise commentedon Apr 5, 2023
@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?
wkeese commentedon Oct 8, 2025
Yes, please reopen this. At the very least, https://tanstack.com/table/latest/docs/framework/react/examples/expanding should be updated to work correctly, but as explained in #4878 this seems like a problem with the library itself rather than a problem with the demo.