Skip to content

Commit 9f53e0a

Browse files
author
Steven G. Harms
committed
menubar: Hovering on sub-menu-less menu-items should close open submenus
Given a menubar with [X] [Y] [Z] Where X and Z both have sub-menus, but Y does not, if the user mouses over Z its sub-menu displays as expected. But hovering over Y does not close Z's menu. The user has to hover over X to close Z's sub-menu. This is unexpected.
1 parent 0d30bda commit 9f53e0a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ui/jquery.ui.menubar.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,13 @@ $.widget( "ui.menubar", {
133133
input.addClass( "ui-state-default" ).append( "<span class='ui-button-icon-secondary ui-icon ui-icon-triangle-1-s'></span>" );
134134
input.removeClass( "ui-button-text-only" ).addClass( "ui-button-text-icon-secondary" );
135135
}
136-
}
136+
} else {
137+
input.bind( "click.menubar mouseenter.menubar", function( event ) {
138+
if ( ( that.open && event.type === "mouseenter" ) || event.type === "click" ) {
139+
that._close();
140+
}
141+
});
142+
}
137143

138144
input
139145
.addClass( "ui-button ui-widget ui-button-text-only ui-menubar-link" )

0 commit comments

Comments
 (0)