-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Open
Description
Describe the bug
row-selection in the group rows are not correctly reacting to their sub-rows row-selection state
Your minimal, reproducible example
https://codesandbox.io/s/row-selection-sub-rows-kfgh2j
Steps to reproduce
- Go to https://codesandbox.io/s/row-selection-sub-rows-kfgh2j
- Expand the first group row
- Select the first sub-row
- ✅ Notice the parent row checkbox being "indeterminate"

- Select the other 2 sub-rows in that same group
- 🛑 Notice the parent row checkbox is "unchecked", when it should be "checked"

Probably the same issue:
- Go to the same codesandbox: https://codesandbox.io/s/row-selection-sub-rows-kfgh2j
- Expand the first group row
- Select the checkbox from the column header
- ✅ Notice all rows (parent and children) are selected

- Unselect the first sub-row of the expanded group
- 🛑 Notice the parent row checkbox is stuck on "checked", when it should be "indeterminate"

Expected behavior
As a user, I expected the parent row to react to the row-selection status of its children, regardless on how they are selected/unselected:
- some sub-rows selected: parent row "indeterminate"
- no sub-rows selected: parent row "unchecked"
- all sub-rows selected: parent row "checked"
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
- Browser: N/A
- OS: N/A
Happens in codesandbox
react-table version
v8.9.1
TypeScript version
N/A - whatever codesandbox uses
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.
ericberens, VincEnterprise, SHANG-TING, artem-zaiko-yara, JosiahETNZ and 13 more
Metadata
Metadata
Assignees
Labels
No labels