primefaces / primereact

The Most Complete React UI Component Library
https://primereact.org
MIT License
6.27k stars 966 forks source link

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

Open MarcinKoziuk opened 1 month ago

MarcinKoziuk commented 1 month ago

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

Expected behavior

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

melloware commented 1 month ago

Most likely just a re-rendering issue which explains why you see it with the more data in the table. Would love some analysis or a PR if someone figures it out!