primereact
primereact copied to clipboard
Column width not change after reorder in datatable
Describe the bug
If I just modify column order it works fine: the column size goes with the modified column. But if i modify column order after i modified the column width, the column width doesn't go with the column, so that the column width don't change.
Reproducer
https://codesandbox.io/s/datatable-reorder-vrlt9g
PrimeReact version
8.3.0
React version
18.x
Language
ES6
Build / Runtime
Create React App (CRA)
Browser(s)
Chrome 103.0.5060.134, Firefox: 103.0.1, Microsoft Edge: 103.0.1264.77
Steps to reproduce the behavior
orig columnWidths from the datatable session state: columnWidths: "59,74,290,44,71"
- Modify a column width
- Modify the column order from position 3 to 2
new columnWidths from the datatable session state:
columnWidths: "59,74,290,44,71"
Expected behavior
If I modify column order from 3 to 2) after I modified a column width, the column widths change.
For example (with datatable session state):
orig columnWidths: "59,74,290,44,71"
new columnWidths: "59,290,74,44,71"