From 763f77fc2f3b3c3c1ce2fa91ae2a8097b11f6b6b Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Mon, 6 Aug 2012 14:48:02 +0000 Subject: Fix and test for #9136 (Tree throws wrong ItemClickEvent in IE9) svn changeset:24087/svn branch:6.8 --- src/com/vaadin/terminal/gwt/client/ui/VTree.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTree.java b/src/com/vaadin/terminal/gwt/client/ui/VTree.java index 1d5ec206aa..2d318522ea 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTree.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTree.java @@ -753,6 +753,10 @@ public class VTree extends FocusElementPanel implements Paintable, if (BrowserInfo.get().isWebkit() && !treeHasFocus) { /* * Safari may need to wait for focus. See FocusImplSafari. + * + * Note that this if/else must exactly match the one in + * fireClick() to ensure that the above click/selection event + * logic works correctly (#9136) */ // VConsole.log("Deferring click handling to let webkit gain focus..."); Scheduler.get().scheduleDeferred(command); @@ -930,13 +934,17 @@ public class VTree extends FocusElementPanel implements Paintable, details.toString(), sendClickEventNow); } }; - if (treeHasFocus) { - command.execute(); - } else { + if (BrowserInfo.get().isWebkit() && !treeHasFocus) { /* * Webkits need a deferring due to FocusImplSafari uses timeout + * + * Note that this if/else must exactly match the one in + * handleClickSelection() to ensure that the above + * click/selection event logic works correctly (#9136) */ Scheduler.get().scheduleDeferred(command); + } else { + command.execute(); } } -- cgit v1.2.3