Skip to content

Table v8 expanding - incorrect state of parent checkbox when selecting subrows #5620

Description

@odini85

TanStack Table version

8.17.3

Framework/Library version

18.2.0

Describe the bug and the steps to reproduce it

The closed issue #4720 has potential bugs.

It can be verified according to the following steps.

1. Apply the code guided in issue #4720 to the sample code below:

https://tanstack.com/table/v8/docs/framework/react/examples/expanding

<IndeterminateCheckbox {...{ checked: row.getIsSelected() || row.getIsAllSubRowsSelected(), indeterminate: row.getIsSomeSelected(), onChange: row.getToggleSelectedHandler(), }} />

2. Implement this guided sample code into the sample code and conduct tests.

3. The potential bugs identified are as follows:

if the parent is checked and all children are checked, unchecking one child does not change the status of the parent checkbox.

issue.1.mov

If all children are individually checked, the parent's checkbox status changes to checked. However, if the parent checkbox is then unchecked, it does not uncheck all the children.

issue.2.mov

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

https://codesandbox.io/p/devbox/jolly-nightingale-k9tx7h

Screenshots or Videos (Optional)

Do you intend to try to help solve this bug with your own PR?

None

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions