8000 DataTable: column order via props breaks after drag & drop reorder · Issue #8477 · primefaces/primereact · GitHub
[go: up one dir, main page]

Skip to content

DataTable: column order via props breaks after drag & drop reorder #8477

@paol-imi

Description

@paol-imi

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.1

Steps to reproduce the behavior

  1. Open the StackBlitz reproducer

  2. Click the Shuffle Columns button → Columns reorder correctly

  3. Drag & drop any column to change its order → Columns reorder correctly

  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Needs TriageIssue will be reviewed by Core Team and a relevant label will be added as soon as possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0