diff options
author | John Alhroos <john.ahlroos@itmill.com> | 2010-09-02 06:35:57 +0000 |
---|---|---|
committer | John Alhroos <john.ahlroos@itmill.com> | 2010-09-02 06:35:57 +0000 |
commit | f22db6380705a8ec404a617d8ea98f5c12e35b93 (patch) | |
tree | 72608e7f773aa234cb42dbd31d725307a7ed49e6 /src | |
parent | a290177252ce8cb8931610bd001c891b09668fd3 (diff) | |
download | vaadin-framework-f22db6380705a8ec404a617d8ea98f5c12e35b93.tar.gz vaadin-framework-f22db6380705a8ec404a617d8ea98f5c12e35b93.zip |
Fix for #5537
svn changeset:14682/svn branch:6.4
Diffstat (limited to 'src')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java b/src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java index 6899a2ca9f..4a8ff451ca 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java @@ -90,7 +90,6 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable, } public VMenuBar(boolean subMenu) { - super(); items = new ArrayList<CustomMenuItem>(); popup = null; @@ -286,7 +285,7 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable, public void onMenuClick(int clickedItemId) { // Cancel the focus event handling since focus was gained by // clicking an item. - if (focusDelayTimer != null) { + if (focusDelayTimer != null || subMenu) { focusDelayTimer.cancel(); } @@ -416,6 +415,15 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable, if (isEnabled() && targetItem.isEnabled()) { itemClick(targetItem); } + if (subMenu) { + // Prevent moving keyboard focus to child menus + VMenuBar parent = parentMenu; + while (parent.getParentMenu() != null) { + parent = parent.getParentMenu(); + } + parent.setFocus(true); + } + break; case Event.ONMOUSEOVER: @@ -428,6 +436,13 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable, itemOut(targetItem); break; } + } else if (subMenu && DOM.eventGetType(e) == Event.ONCLICK && subMenu) { + // Prevent moving keyboard focus to child menus + VMenuBar parent = parentMenu; + while (parent.getParentMenu() != null) { + parent = parent.getParentMenu(); + } + parent.setFocus(true); } } |