Menu: Remove close delay for keyboard interaction to fix an issue with properly adding and removing ui-state-active class during quick navigation through submenus

This commit is contained in:
kborchers
2012-05-08 23:53:14 -05:00
parent eaec319df3
commit 97cb7decee

10
ui/jquery.ui.menu.js vendored
View File

@@ -330,9 +330,13 @@ $.widget( "ui.menu", {
// highlight active parent menu item, if any
this.active.parent().closest( ".ui-menu-item" ).children( "a:first" ).addClass( "ui-state-active" );
this.timer = this._delay(function() {
this._close();
}, this.delay );
if ( event.type === "keydown" ) {
this._close();
} else {
this.timer = this._delay(function() {
this._close();
}, this.delay );
}
nested = $( "> .ui-menu", item );
if ( nested.length && ( /^mouse/.test( event.type ) ) ) {