-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Describe the bug
When using DataTable with reorderable columns, column ordering works correctly either via props or via drag & drop.
However, after a drag & drop reorder occurs, updating the column order again via props no longer works correctly.
This makes it impossible to reliably control column order from external state once the user interacts with column reordering.
Reproducer
https://stackblitz.com/edit/umv9mwqp?file=src%2FApp.jsx
System Information
primereact: 10.9.7
react: 18.3.1Steps to reproduce the behavior
-
Open the StackBlitz reproducer
-
Click the Shuffle Columns button → Columns reorder correctly
-
Drag & drop any column to change its order → Columns reorder correctly
-
Click the Shuffle Columns button again → Column order does not update correctly / remains stuck
Expected behavior
After using drag & drop to reorder columns, updating the column order via props (e.g. clicking the Shuffle button) should still reorder the columns according to the provided prop/state order.
The DataTable should remain fully controllable by external column state even after user interaction.