Skip to content

Commit 97cb7de

Browse files
committed
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
1 parent eaec319 commit 97cb7de

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ui/jquery.ui.menu.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,13 @@ $.widget( "ui.menu", {
330330
// highlight active parent menu item, if any
331331
this.active.parent().closest( ".ui-menu-item" ).children( "a:first" ).addClass( "ui-state-active" );
332332

333-
this.timer = this._delay(function() {
334-
this._close();
335-
}, this.delay );
333+
if ( event.type === "keydown" ) {
334+
this._close();
335+
} else {
336+
this.timer = this._delay(function() {
337+
this._close();
338+
}, this.delay );
339+
}
336340

337341
nested = $( "> .ui-menu", item );
338342
if ( nested.length && ( /^mouse/.test( event.type ) ) ) {

0 commit comments

Comments
 (0)