Skip to content

Row selection acting strange when using fully controlled table #4812

Description

@changyeamoon

Describe the bug

When I try to use table row selection with fully controlled state and i'm on the second page, then it selects the first page.

I think it's either the selection function is not accounting for the page index in getToggleAllPageRowsSelectedHandler OR it is re-rendering the page index back to 0.

Your minimal, reproducible example

https://codesandbox.io/s/tanstack-table-fullycontrolled-w-selection-gmuhmm?file=/src/main.tsx:667-702

Steps to reproduce

  1. Go to second, third, or fourth page of table
  2. Click the header selection
  3. See that something did get selected.
  4. Go back to first page and see the first page gets selected.

Expected behavior

As a user I expect to see the page that im on get selected when using the header selection.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

mac OS, chrome, Version 112.0.5615.49 (Official Build) (arm64)

react-table version

8.8.5

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