vaadin / flow-components

Java counterpart of Vaadin Web Components
99 stars 66 forks source link

Reordering frozen column #1488

Open flefebure opened 4 years ago

flefebure commented 4 years ago

Hi, vaadin-grid-flow:4.1.3 Columns that have been frozen then unfrozen can't be reordered by drag'n drop.

tomivirkki commented 4 years ago

Hi, Tested with vaadin-grid-flow:4.1.3 and this works fine for me:

Kapture 2020-05-06 at 14 53 34

flefebure commented 4 years ago

Hi Tomi, Thanks for your quick answer. I've made a little example on github to reproduce it https://github.com/flefebure/vaadin-test-grid The key is that the grid has a second header row

HeaderRow secondHeaderRow = grid.appendHeaderRow();

https://github.com/flefebure/vaadin-test-grid/blob/a606385ba6eb65fc726c95f325dac34d080a1000/src/main/java/com/test/TestGridRoute.java#L86

tomivirkki commented 4 years ago

Ok that seems quite broken indeed. Thanks for the clarification. Looks like the frozen property of a vaadin-grid-column-group isn't correctly synced to the child column or vice-versa.

flefebure commented 2 years ago

Hello Tomi, we are still annoyed with this little bug. Can Vaadin try to cover it ? (for what it's worth, we have pro licenses)

tomivirkki commented 2 years ago

Hi, and sorry for the delay. Took another look and it seems the bug is still there even in V23.

Looks like unfreezing a child column is intentionally ignored by a parent column group.

https://user-images.githubusercontent.com/1222264/163960285-48622f76-4910-4fdf-b02f-892c54f7acd0.mp4

The issue should be fixed, but as a workaround, you could manually unfreeze the parent column group also:

// Unfreeze the columns
grid.getColumnByKey("column1").setFrozen(false);
grid.getColumnByKey("column2").setFrozen(false);

// Manually unfreeze the column groups
grid.getColumnByKey("column1").getElement().getParent().setProperty("frozen", false);
grid.getColumnByKey("column2").getElement().getParent().setProperty("frozen", false);
flefebure commented 2 years ago

Thanks Tomi for this cool workaround ..Should have digged by myself Franck