Clicking on a MenuItem does not close its child menu if autoOpen is enabled, unless the MenuItem has its own Command associated with it.
Patch by: jlabanca
Review by: ajr
Issue: 2641
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@3625 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/user/client/ui/MenuBar.java b/user/src/com/google/gwt/user/client/ui/MenuBar.java
index 929fb47..bcc74ff 100644
--- a/user/src/com/google/gwt/user/client/ui/MenuBar.java
+++ b/user/src/com/google/gwt/user/client/ui/MenuBar.java
@@ -624,12 +624,12 @@
shownChildMenu.onHide();
popup.hide();
openPopup(item);
- } else if (fireCommand) {
+ } else if (fireCommand && !autoOpen) {
// close this submenu
shownChildMenu.onHide();
popup.hide();
shownChildMenu = null;
- selectItem(null);
+ selectItem(item);
}
} else if (autoOpen && shownChildMenu != null) {
// close submenu