TanStack / TanStack/table

[Feature] Keep sorting order after changing row information

Open
#5,792 0 comments 0 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

I would like to discuss a new feature to keep the table with the same sorting data on screen after the user has changed the visible row information.
As it is, if you sort the column "numbers" as ASC:

numbers
1
2
6
10

and then change the value "2" to "8", for example, the table will refresh like this:

numbers
1
6
8
10

But, what I want is to keep it like it were with the new value:

numbers
1
8
6
10

A possible solution would be to implement a new parameter into the table to store the changed rows and a new function in getSortedRowModel where, before you return the sortedData, you would get these rows and place them in their original position.

The user would need to provide the table with the changed rows in order to use the feature, otherwise it would behave as usual.

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 by reading the getSortedRowModel entry point mentioned in the issue and trace how edited rows could be identified and positioned. Define the table parameter and sorting behavior for changed rows, while preserving current behavior when no changed rows are supplied; done means the example keeps the edited row in its original position and unchanged rows retain normal sorting.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.