BUG: double click not firing

12 views
Skip to first unread message

cole...@gmail.com

unread,
Aug 12, 2006, 7:05:18 PM8/12/06
to Google Web Toolkit
The double click doesn't fire in IE6 -- or at least not on the correct
element. This is because the __dispatchDblClickEvent function in
DOMImplIE6::init, calls $wnd.__dispatchEvent(), which uses the "this"
object to find an event listener. However, when __dispatchEvent() is
called from __dispatchDblClickEvent the "this" object is $wnd, when it
should be the element that fired the event.

A simple fix is to replace the $wnd.__dispatchEvent() call with
$wnd.__dispatchEvent.call(this);

Here's a test class:

public class Test implements EntryPoint {

private HTML debug;

public void onModuleLoad() {
debug = new HTML();
FlowPanel panel = new FlowPanel() {
public void onBrowserEvent(Event event) {
debug.setHTML(debug.getHTML() + "<br/>" +
DOM.eventGetTypeString(event));
}
};
panel.sinkEvents(Event.ONCLICK | Event.ONDBLCLICK);

DOM.setStyleAttribute(panel.getElement(), "border", "1px solid
blue");
panel.setSize("100px", "100px");

RootPanel.get().add(panel);
RootPanel.get().add(debug);
}
}

hoosie

unread,
Aug 12, 2006, 7:54:26 PM8/12/06
to Google Web Toolkit
Good catch on how to fix that, I've been forced to use EventPreviews to
fire the double click. This problem was the same in v1.0.21 as well,
hopefully it will make the next release!
Reply all
Reply to author
Forward
0 new messages