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 row selection issues when some rows have selection disabled #5060
I've noticed some table issues when some rows have row selection disabled:
Rows that are not selectable prevent row.getIsAllSubRowsSelected() or table.getIsSomeRowsSelected() from returning true even when all selectable rows are selected.
Using row.toggleSelected(..) on an expandable row with selection disabled (but enableSubRowSelection = true) only works to select all sub-rows. Further calls to row.toggleSelected(..) do not de-select the sub-rows.
These issues are making it harder for me to implement custom "cascading" behavior.
In the below example selection is disabled for rows:
that can expand
that are the last child
A
B
Reproduction A:
Expand the first row.
Select all sub-rows of the first expanded row.
The parent-row selection checkbox still shows as indeterminate.
Reproduction B:
Expand all parent rows.
Select all sub-rows under all parent rows.
Both the parent-row selection checkboxes, and the header checkboxes still show as indeterminate.
Reproduction C:
Expand the first row.
Click the toggle button next to the parent row.
Click the toggle button again (and again, and again).
Notice that the toggle button fails to deselect the now-selected rows.
Expected behavior
A
B
Reproduction A:
The first expandable row checkbox should show as checked.
Reproduction B:
All checkboxes should show as checked.
Reproduction C:
Subsequent clicks of toggle should de-select, and then re-select the sub-rows.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
OS: Windows 11
Browser: Firefox
Version: 117.0
react-table version
8.9.7
TypeScript version
No response
Additional context
I'm in the process of tidying up some changes that address these issues.
I will push these changes and open a PR momentarily.
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.
changed the title [-]Table row selection issues when some rows have row selection disabled[/-][+]Table row selection issues when some rows have selection disabled[/+]on Sep 7, 2023
Activity
[-]Table row selection issues when some rows have row selection disabled[/-][+]Table row selection issues when some rows have selection disabled[/+]