-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Describe the bug (required)
TLDR; When getRows defined, subRows are not get selected when parent selected.
Looking into the src code, https://github.com/tannerlinsley/react-table/blob/master/src/plugin-hooks/useRowSelect.js#L170
useSelected retrieve subRows using getSubRow(), it pass the row instance instead of row original data. Which cause the problem.
I think we are safe to use row.subRows here since subRows already computed inside useTable https://github.com/tannerlinsley/react-table/blob/master/src/hooks/useTable.js#L549-L558
Provide an example via Codesandbox! (required)
https://codesandbox.io/s/priceless-currying-5mwss?file=/src/App.js
Steps To Reproduce (required)
Steps to reproduce the behavior:
- Go to
- Click on first row
- Click on expand
Expected behavior (Recommended)
All sub rows should get selected
Additional context
Add any other context about the problem here.
