Skip to content

[v8] When multi row selection is disabled and sub rows are used sometimes a wrong row is selected  #4299

Description

@dudel

Describe the bug

When setting enableMultiRowSelection to false and selecting a non-leaf row which has sub rows the last leaf row in the hierarchy is selected instead of the clicked row.

The reproducable example is based on the official row selection example with enableMultiRowSelection set to false.

Your minimal, reproducible example

https://codesandbox.io/s/funny-driscoll-06ptlp?file=/src/main.tsx

Steps to reproduce

  • Expand a row and sub rows down to it's leaf rows
  • Select any non-leaf row from the expanded rows
    --> The last leaf-row is selected but the clicked non-leaf row is not selected

Expected behavior

As a user, I expect to select the clicked row, but I am seeing that another (the last leaf-row in the hierarchy of the clicked row) is selected.

How often does this bug happen?

Every time

Screenshots or Videos

image

Platform

  • OS: Windows
  • Browser: Chrome (104), but also Firefox and Edge

react-table version

8.5.11

TypeScript version

4.7.4

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