primefaces / primereact

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

DataTable: Static and dynamic column reorder issue #6298

Open emreakdas opened 5 months ago

emreakdas commented 5 months ago

Describe the bug

Two separate children did not exhibit the expected behavior.

Reproducer

https://stackblitz.com/edit/gjka9l?file=src%2FApp.jsx

PrimeReact version

latest

React version

18.x

Language

ALL

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

  1. Open Stackblitz
  2. Remove category from show column hide
  3. Make Quantity a little smaller
  4. Move Quantity to the left of name (at the beginning)
  5. Add category from show column hide
  6. Category will be added at the end of "Test".

Expected behavior

The category keeps its previous position or comes before "Test".

Since Test is a separate mapping, it should remain fixed.

emreakdas commented 5 months ago

The same thing happens in this example https://stackblitz.com/edit/iuiaxy?file=src%2FApp.jsx. The fixed element never keeps its position.