aboutsummaryrefslogtreecommitdiffstats
path: root/compatibility-client/src
diff options
context:
space:
mode:
authorAnna Koskinen <Ansku@users.noreply.github.com>2020-05-19 13:13:25 +0300
committerGitHub <noreply@github.com>2020-05-19 13:13:25 +0300
commit0645a86e5b6951de0e5b170657a2eaf74a7e9b77 (patch)
tree9c327c0e4f21a129a8815ae796196aaf5ff3ce51 /compatibility-client/src
parent667da64f804528a3e4a93dda3db708085104b844 (diff)
downloadvaadin-framework-0645a86e5b6951de0e5b170657a2eaf74a7e9b77.tar.gz
vaadin-framework-0645a86e5b6951de0e5b170657a2eaf74a7e9b77.zip
Table / TreeTable multiselect disabling of touch detection (#12014)
Added a toggle in Table (and thus TreeTable) where you can explicitly disable multiselect touch screen detection. This allows you to work around issues on hybrid devices that have both a touch screen and a keyboard where you don't want automatic simple multiselection applied. Fixes #11601, slightly modified cherry-pick of #11641
Diffstat (limited to 'compatibility-client/src')
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java
index 4b0a52c1bd..c4294009d2 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java
@@ -349,6 +349,8 @@ public class VScrollTable extends FlowPanel
private SelectMode selectMode = SelectMode.NONE;
+ private boolean multiSelectTouchDetectionEnabled = true;
+
public final HashSet<String> selectedRowKeys = new HashSet<String>();
/*
@@ -1502,6 +1504,10 @@ public class VScrollTable extends FlowPanel
} else {
selectMode = SelectMode.NONE;
}
+ if (uidl.hasAttribute("touchdetection")) {
+ multiSelectTouchDetectionEnabled = uidl
+ .getBooleanAttribute("touchdetection");
+ }
}
}
@@ -1951,9 +1957,10 @@ public class VScrollTable extends FlowPanel
}
private void setMultiSelectMode(int multiselectmode) {
- if (BrowserInfo.get().isTouchDevice()) {
+ if (BrowserInfo.get().isTouchDevice()
+ && multiSelectTouchDetectionEnabled) {
// Always use the simple mode for touch devices that do not have
- // shift/ctrl keys
+ // shift/ctrl keys (unless this feature is explicitly disabled)
this.multiselectmode = MULTISELECT_MODE_SIMPLE;
} else {
this.multiselectmode = multiselectmode;