diff options
-rw-r--r-- | ui/jquery.ui.menu.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index bcefd5822..8956d6404 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -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 ) ) ) { |