Skip to content

Commit

Permalink
fix: fix double-click in read-only mode
Browse files Browse the repository at this point in the history
Close #177
  • Loading branch information
javier-godoy committed Oct 9, 2024
1 parent aea4ebc commit 9aaa8e2
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public enum Orientation {
private boolean explicitHeaderRow = true;

private String layoutId;

private static <T> ListDataProvider<T> emptyDataProvider() {
return DataProvider.ofCollection(new LinkedHashSet<>());
}
Expand Down Expand Up @@ -339,7 +339,7 @@ private String getLayoutId() {
return this.layoutId = "twincol-" + UUID.randomUUID();
});
}

private HorizontalLayout createHorizontalContainer(boolean reverse) {
buttonContainer = getVerticalButtonContainer();
HorizontalLayout hl;
Expand Down Expand Up @@ -928,12 +928,14 @@ public void setMoveItemsByDoubleClick(boolean value) {
side.moveItemsByDoubleClick =
side.grid.addItemDoubleClickListener(
ev -> {
Set<T> item = Collections.singleton(ev.getItem());
if (side == available) {
updateSelection(item, Collections.emptySet(), true);
}
if (side == selection) {
updateSelection(Collections.emptySet(), item, true);
if (!isReadOnly()) {
Set<T> item = Collections.singleton(ev.getItem());
if (side == available) {
updateSelection(item, Collections.emptySet(), true);
}
if (side == selection) {
updateSelection(Collections.emptySet(), item, true);
}
}
});
}
Expand Down

0 comments on commit 9aaa8e2

Please sign in to comment.