Fix issue toggling row selection for a grouped row
Resolves #4759
Toggling a grouped row can have up to two effects:
- Update the selected state of the grouped row if that grouped row supports selection
- Update the selected state of subrows if
getCanSelectSubRowsistrue
toggleSelected() returned early if the selected state of the row wasn't going to change without any consideration of whether the selected state of subrows also needed to be updated. With this change, toggleSelected() now considers both if the rows selection state will change and if subrow selection state might change before returning early.
I've added some selection tests to table-core -- both a few basic tests and some tests that cover the issue I am fixing.
@mollykreis is attempting to deploy a commit to the Tanstack Team on Vercel.
A member of the Team first needs to authorize it.
Unsure if this change is needed as discussed here: https://github.com/TanStack/table/issues/4759#issuecomment-1483985451