TanStack / TanStack/table

[React] Row selection does not reset after upgrading from v7 to v8

Open
#4,498 7 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
28.4k
Forks
3.6k
Avg merge
1d 14h
Merged PRs (30d)
10

Description

Describe the bug

Hello,

first, thank you for your awesome job, v8 is by far better than v7, I appreciate all the effort you put on it.
I'm pointing this issue as a Bug because I couldn't find any information on the documentation about it, so if it is not a bug, my apologies.

In v7, there was the option autoResetSelectedRows that (it was set by default to true) resets the selected rows whenever the data changes.
In v8, this option is not there anymore and the default behaviour is exactly the opposite.

I would like to know, first, if that was intended, second, if there are plans to restore the configuration option autoResetSelectedRows and when?

A reproducible repo could be found on your documentation pages: https://2llvty.sse.codesandbox.io

Your minimal, reproducible example

https://2llvty.sse.codesandbox.io

Steps to reproduce

Open https://2llvty.sse.codesandbox.io

Select the first 2 rows (checkbox)

Press on refresh data (button) at the bottom

Result:
Data is refreshed and the rows remain selected, even though data did change.

Expected behavior

After data was refreshed, the selection should have been reset, same as it was in v7.

Or there is an option like autoResetSelectedRows that I could set in order to obtain the same behaviour as in v7.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform
  • Os: [macOS] - Browser: [Chrome, Firefox]
react-table version

"@tanstack/react-table": "^8.5.22",

TypeScript version

v4.7.3

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox reproduction and compare the documented v7 behavior of autoResetSelectedRows with the v8 selection behavior. Confirm what happens after the refresh-data action, then inspect the v8 row-selection entry points to determine whether the expected reset or a configuration option is intended; done means the reproduced selection behavior matches the agreed result.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.