Committing ecc's patch for issue 926. The issue was caused by another fix to the
event system that was causing events to propagate when they shouldn't. This
patch addresses this by directly hooking the focusable element's onfocus event.
Patch by: ecc
Review by: jgw
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@998 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 34d21a4..5e89bdd 100644
--- a/user/src/com/google/gwt/user/client/ui/Tree.java
+++ b/user/src/com/google/gwt/user/client/ui/Tree.java
@@ -80,8 +80,7 @@
DOM.appendChild(getElement(), focusable);
sinkEvents(Event.MOUSEEVENTS | Event.ONCLICK | Event.KEYEVENTS);
- DOM.sinkEvents(focusable, Event.FOCUSEVENTS | Event.KEYEVENTS
- | DOM.getEventsSunk(focusable));
+ DOM.sinkEvents(focusable, Event.FOCUSEVENTS);
// The 'root' item is invisible and serves only as a container
// for all top-level items.
@@ -528,6 +527,7 @@
Widget child = (Widget) it.next();
child.onAttach();
}
+ DOM.setEventListener(focusable, this);
}
protected void onDetach() {
@@ -538,6 +538,7 @@
Widget child = (Widget) it.next();
child.onDetach();
}
+ DOM.setEventListener(focusable, null);
}
protected void onLoad() {