From 18dd267cfe3757adee20aaae556b64746c677683 Mon Sep 17 00:00:00 2001 From: Automerge Date: Thu, 5 Apr 2012 13:08:30 +0000 Subject: [PATCH] [merge from 6.7] Fix #8595: Always use MULTISELECT_MODE_SIMPLE for touch devices svn changeset:23414/svn branch:6.8 --- src/com/vaadin/terminal/gwt/client/ui/VTree.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTree.java b/src/com/vaadin/terminal/gwt/client/ui/VTree.java index 2be01df8cc..1d5ec206aa 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTree.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTree.java @@ -66,7 +66,14 @@ public class VTree extends FocusElementPanel implements Paintable, public static final String ITEM_CLICK_EVENT_ID = "itemClick"; + /** + * Click selects the current node, ctrl/shift toggles multi selection + */ public static final int MULTISELECT_MODE_DEFAULT = 0; + + /** + * Click/touch on node toggles its selected status + */ public static final int MULTISELECT_MODE_SIMPLE = 1; private static final int CHARCODE_SPACE = 32; @@ -299,7 +306,13 @@ public class VTree extends FocusElementPanel implements Paintable, isMultiselect = "multi".equals(selectMode); if (isMultiselect) { - multiSelectMode = uidl.getIntAttribute("multiselectmode"); + if (BrowserInfo.get().isTouchDevice()) { + // Always use the simple mode for touch devices that do not have + // shift/ctrl keys (#8595) + multiSelectMode = MULTISELECT_MODE_SIMPLE; + } else { + multiSelectMode = uidl.getIntAttribute("multiselectmode"); + } } selectedIds = uidl.getStringArrayVariableAsSet("selected"); -- 2.39.5