From 2cbaa342d34c0bee63a43ba51c21896e134dae87 Mon Sep 17 00:00:00 2001 From: Anna Koskinen Date: Wed, 13 Oct 2021 17:13:17 +0300 Subject: Fix compatibility Grid column reorder of partially hidden joined cells. (#12427) Adds the fix from #12386 to the drag source as well. Fixes #12377 --- .../src/main/java/com/vaadin/v7/client/widgets/Grid.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'compatibility-client') diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java b/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java index efd50e3d1e..03556e3f79 100755 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java @@ -4485,8 +4485,11 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, @Override public void onDrop() { final int draggedColumnIndex = eventCell.getColumnIndex(); - final int colspan = header.getRow(eventCell.getRowIndex()) - .getCell(eventCell.getColumn()).getColspan(); + final StaticRow draggedCellRow = header + .getRow(eventCell.getRowIndex()); + Set> cellGroup = draggedCellRow + .getCellGroupForColumn(getColumn(draggedColumnIndex)); + final int colspan = cellGroup == null ? 1 : cellGroup.size(); if (latestColumnDropIndex != draggedColumnIndex && latestColumnDropIndex != draggedColumnIndex + colspan) { List> columns = getColumns(); -- cgit v1.2.3