Skip to content

getToggleAllRowsSelectedHandler is selecting not allowed rows. #4121

Description

@jpedroh

Describe the bug

Hello!

The table method getToggleAllRowsSelectedHandler is selecting all rows, even the ones which return false for the getCanSelect row check. I don't know if this is either a bug or intended behaviour though.

Your minimal, reproducible example

https://codesandbox.io/s/romantic-silence-sh1x95

Steps to reproduce

  1. First, notice that by table definition in line 115, only rows with age greater than 18 should be able to be selected. enableRowSelection: (row) => row.original.age > 18,
  2. Check that the checkboxes for ages smaller than 18 are disabled.
  3. Tick select all. All the boxes will be checked, even the disabled ones.

Expected behavior

The disabled checkboxes should not be checked.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

React 18, Chrome 103, Windows 10.

react-table version

8.2.0

TypeScript version

No response

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