Fixed issue 3307 by not gating the selection of an item on whether it is focusable
Review by:jlabanca
git-svn-id: https://google-web-toolkit.googlecode.com/svn/releases/1.6@4521 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/user/client/ui/Tree.java b/user/src/com/google/gwt/user/client/ui/Tree.java
index 9dff280..e6b5a07 100644
--- a/user/src/com/google/gwt/user/client/ui/Tree.java
+++ b/user/src/com/google/gwt/user/client/ui/Tree.java
@@ -929,7 +929,7 @@
DOM.setIntStyleAttribute(focusable, "zIndex", -1);
DOM.appendChild(getElement(), focusable);
- sinkEvents(Event.MOUSEEVENTS | Event.ONCLICK | Event.KEYEVENTS);
+ sinkEvents(Event.ONMOUSEDOWN | Event.ONCLICK | Event.KEYEVENTS);
DOM.sinkEvents(focusable, Event.FOCUSEVENTS);
// The 'root' item is invisible and serves only as a container
@@ -1154,9 +1154,10 @@
}
curSelection = item;
- if (moveFocus && curSelection != null) {
- moveFocus();
-
+ if (curSelection != null) {
+ if (moveFocus) {
+ moveFocus();
+ }
// Select the item and fire the selection event.
curSelection.setSelected(true);
if (fireEvents) {