primefaces / primefaces/primereact
DataTable: dynamic column order did not work after manually drag/drop column for ordering.
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 8.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Initially, you can sort columns by clicking a button. Then, you can manually rearrange the table by dragging and dropping. However, after clicking the button, the dynamic column sorting stops working.
Reproducer
PrimeReact version
10.6.2
React version
17.x
Language
ALL
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
- Go to Sandbox https://codesandbox.io/p/sandbox/amazing-jennings-z27r2m?file=%2Fsrc%2Fdemo%2FDataTableReorderDemo.js%3A16%2C30
- Click on "Reorder Column" button at top-left-below page. This will reorder the column randomly.
- Then manually drag and drop the table header to re-order the column (i.e. reorder "Quantity", "Name", "Category", "Code")
- Click on "Reorder Column" button again. The reorder will stop working.
Expected behavior
The column header should be able to be sorted dynamically after manually drag & drop.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked CodeSandbox entry point, DataTableReorderDemo.js, and reproduce the sequence of clicking "Reorder Column," manually dragging a header, then clicking the button again. Trace the DataTable column-reordering behavior involved in that sequence; done means dynamic reordering still works after manual drag-and-drop, while preserving the demonstrated behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100