primereact icon indicating copy to clipboard operation
primereact copied to clipboard

Column width not change after reorder in datatable

Open lio016 opened this issue 3 years ago • 0 comments

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"

  1. Modify a column width
  2. 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"

lio016 avatar Aug 05 '22 12:08 lio016