Fix for CheckBox not registering ClickEvents under the new event
bubbling code, long term, we need a more general solution.
Review by:jgw
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@801 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/user/client/ui/CheckBox.java b/user/src/com/google/gwt/user/client/ui/CheckBox.java
index 133e7f5..de9a391 100644
--- a/user/src/com/google/gwt/user/client/ui/CheckBox.java
+++ b/user/src/com/google/gwt/user/client/ui/CheckBox.java
@@ -78,7 +78,6 @@
// Add focus event to actual input widget. Required by Opera and old
// Mozilla.
- unsinkEvents(Event.FOCUSEVENTS | Event.ONCLICK);
DOM.sinkEvents(inputElem, Event.FOCUSEVENTS | Event.ONCLICK
| DOM.getEventsSunk(inputElem));
@@ -116,6 +115,16 @@
return !DOM.getBooleanAttribute(inputElem, "disabled");
}
+ public void onBrowserEvent(Event event) {
+ // Block the events from the label as they are automatically delegated to
+ // the event.
+ if (DOM.eventGetTarget(event).equals(labelElem)) {
+ return;
+ } else {
+ super.onBrowserEvent(event);
+ }
+ }
+
public void setAccessKey(char key) {
DOM.setAttribute(inputElem, "accessKey", "" + key);
}