primefaces / primefaces/primereact

DataTable: Wrong value briefly flashes when using sortable Columns in combination with editMode

Open
#6,734 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

When using the <Column />'s sortable property in combination with editor and any editMode in <DataTable />, the editor sometimes displays an outdated value momentarily after sorting the rows.

This issue is less noticeable with smaller tables but becomes increasingly apparent as the number of elements grow.

Reproducer

https://stackblitz.com/edit/vitejs-vite-iibrgb?file=src%2FApp.tsx

PrimeReact version

10.6.6

React version

18.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior
  • Create a table with editable and sortable columns
  • Change the sorting of rows
  • Invoke edit mode of a cell which had been affected by sorting
Expected behavior

The configured editor is always rendered with a correct value after sorting the rows.

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 DataTable and Column editing and sorting behavior shown in the linked StackBlitz reproducer. Reproduce the stale editor value after sorting, then trace the relevant DataTable rendering and editor state handling. Done means the configured editor always displays the current cell value after rows are sorted.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.