From aea4ebcf196292e91b7b21ba59a4f3087cf774b2 Mon Sep 17 00:00:00 2001 From: Javier Godoy <11554739+javier-godoy@users.noreply.github.com> Date: Wed, 9 Oct 2024 14:07:07 -0300 Subject: [PATCH 1/2] build: upgrade vaadin version to 14.11.13 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c0253a8..a19e003 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ https://www.flowingcode.com/en/open-source/ - 14.8.20 + 14.11.13 1.8 1.8 UTF-8 From 9aaa8e23bdd85f42135af592ec2d7da374ddf765 Mon Sep 17 00:00:00 2001 From: Javier Godoy <11554739+javier-godoy@users.noreply.github.com> Date: Wed, 9 Oct 2024 14:21:49 -0300 Subject: [PATCH 2/2] fix: fix double-click in read-only mode Close #177 --- .../vaadin/addons/twincolgrid/TwinColGrid.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColGrid.java b/src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColGrid.java index 149aeb4..9a1db35 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColGrid.java +++ b/src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColGrid.java @@ -150,7 +150,7 @@ public enum Orientation { private boolean explicitHeaderRow = true; private String layoutId; - + private static ListDataProvider emptyDataProvider() { return DataProvider.ofCollection(new LinkedHashSet<>()); } @@ -339,7 +339,7 @@ private String getLayoutId() { return this.layoutId = "twincol-" + UUID.randomUUID(); }); } - + private HorizontalLayout createHorizontalContainer(boolean reverse) { buttonContainer = getVerticalButtonContainer(); HorizontalLayout hl; @@ -928,12 +928,14 @@ public void setMoveItemsByDoubleClick(boolean value) { side.moveItemsByDoubleClick = side.grid.addItemDoubleClickListener( ev -> { - Set item = Collections.singleton(ev.getItem()); - if (side == available) { - updateSelection(item, Collections.emptySet(), true); - } - if (side == selection) { - updateSelection(Collections.emptySet(), item, true); + if (!isReadOnly()) { + Set item = Collections.singleton(ev.getItem()); + if (side == available) { + updateSelection(item, Collections.emptySet(), true); + } + if (side == selection) { + updateSelection(Collections.emptySet(), item, true); + } } }); }