Skip to content

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

Description

@aleksygoroszko

Describe the bug

When selecting subrows the parent checkbox does not get correct state

Your minimal, reproducible example

https://codesandbox.io/s/github/tanstack/table/tree/main/examples/react/expanding

Steps to reproduce

The bug can be reproduced in official demo:
https://codesandbox.io/s/github/tanstack/table/tree/main/examples/react/expanding

How to reproduce:

  1. Expand the row
    1

  2. Begin selecting subrows, the parent checkbox shows partial selection, which is correct
    2

  3. When selecting last subrow, the parent row is set as unchecked, but should be checked to mark that all subrows are selected.
    3

Selecting/unselecting parent checkox selects/unselects all subrows correctly

Expected behavior

Selecting all subrows must mark parent checkbox as checked

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

Windows, Chrome 110.0.5481.104

react-table version

8.7.9

TypeScript version

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.

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