vaadin / flow-components

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

Grid: Column reordering does not work if you have a grid with 2 footer rows #4520

Open rappenze opened 1 year ago

rappenze commented 1 year ago

Description

When you add two footer rows to a grid, the column reordering does not work. It works correct if you just have no footer rows or one footer row.

Expected outcome

Column reordering within a grid works even when two footer rows are added.

Minimal reproducible example

import com.vaadin.flow.component.grid.Grid;
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.router.Route;

@Route("test")
public class TestView extends Div {
  public TestView() {
    Grid<String> grid = new Grid<>();
    grid.setColumnReorderingAllowed(true);
    grid.addColumn(row -> row).setHeader("Column 1");
    grid.addColumn(row -> row).setHeader("Column 2");
    grid.addColumn(row -> row).setHeader("Column 3");

    grid.setItems("Row 1", "Row 2", "Row 3");

    grid.appendFooterRow();
    grid.appendFooterRow();

    add(grid);
  }
}

Steps to reproduce

Try to reorder a column by using drag&drop.

Environment

Vaadin version(s): 23.3.2 OS: Windows

Browsers

Issue is not browser related

tomivirkki commented 1 year ago

Reordering columns with the attached example works fine on Vaadin 24:

https://user-images.githubusercontent.com/1222264/217472559-cdb77c6b-76f7-4d4b-abe0-2fd5abd75e07.mp4

Confirmed that Vaadin 23 still has the issue:

https://user-images.githubusercontent.com/1222264/217472650-a4386404-4af1-447d-9655-7c4755cb8542.mp4