TreeTable: onValueChange doesn't retrieve the initial data when removableSort is passed

Open
#8,485 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, react
Domain
frontend

Research direction

Start with the linked StackBlitz reproducer using PrimeReact 10.9.7 and trace the TreeTable behavior involving removableSort and onValueChange. Reproduce the third sort or reset, then verify that the rows received by onValueChange remain in the same order as the displayed rows.

Written by the indexing model from the issue text.

Description

Status: Needs Triage
Describe the bug

When the sort is reset, the onValueChange retrieves a wrong value.

Reproducer

https://stackblitz.com/edit/i3yupjwe-5ivzjcju?file=src%2FApp.jsx

System Information
primereact: 10.9.7
Steps to reproduce the behavior
  1. Sort the name column

The retrieved value is good ✅

Image
  1. Re-sort the name column

The retrieved value is good ✅

Image
  1. Re-sort the name column

The retrieved rows are not in the same order as the displayed rows.

Image
Expected behavior

The retrieved rows should always have the same order as the displayed rows.

Dominant language
CSS
Stars
8.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Getting set up

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.

More from primefaces/primereact

All issues in primefaces/primereact

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.