summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnna Koskinen <Ansku@users.noreply.github.com>2020-04-28 16:03:19 +0300
committerGitHub <noreply@github.com>2020-04-28 16:03:19 +0300
commit1171a5099f1a305311fc82a009785b166468ade3 (patch)
tree2ca08eb776005a2a0a3e0db1c4b21ad30539a60e
parent2d441b3f725c065a1f3e72ed91ae2c218f954b2f (diff)
downloadvaadin-framework-1171a5099f1a305311fc82a009785b166468ade3.tar.gz
vaadin-framework-1171a5099f1a305311fc82a009785b166468ade3.zip
Fix hiding / un-hiding with frozen columns in multiselect mode (#11972) (#11975)
The previous patch https://github.com/vaadin/framework/pull/11951 did fix the problem (frozen column indicator wrongly positioned) it was meant to, but caused a regression in hiding / un-hiding. This new fix addresses both problems, i.e. it applies multiselect column compensation in other way, without causing problem in hiding / un-hiding logic Fixes https://github.com/vaadin/framework/issues/11970
-rwxr-xr-xclient/src/main/java/com/vaadin/client/widgets/Grid.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/client/src/main/java/com/vaadin/client/widgets/Grid.java b/client/src/main/java/com/vaadin/client/widgets/Grid.java
index 01c069143b..6d22dfc5ca 100755
--- a/client/src/main/java/com/vaadin/client/widgets/Grid.java
+++ b/client/src/main/java/com/vaadin/client/widgets/Grid.java
@@ -5324,10 +5324,6 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
int columnIndex = grid.getVisibleColumns()
.indexOf(this);
- // Correct column index for multiselect mode
- if (grid.getSelectionColumn().isPresent()) {
- columnIndex--;
- }
grid.escalator.getColumnConfiguration()
.insertColumns(columnIndex, 1);
@@ -5335,6 +5331,10 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
// escalator doesn't handle situation where the added column
// would be the last frozen column
int gridFrozenColumns = grid.getFrozenColumnCount();
+ // Correct column index for multiselect mode
+ if (grid.getSelectionColumn().isPresent()) {
+ gridFrozenColumns++;
+ }
int escalatorFrozenColumns = grid.escalator
.getColumnConfiguration().getFrozenColumnCount();
if (gridFrozenColumns > escalatorFrozenColumns