diff options
author | kborchers <kris.borchers@gmail.com> | 2012-05-08 23:53:14 -0500 |
---|---|---|
committer | kborchers <kris.borchers@gmail.com> | 2012-05-08 23:53:14 -0500 |
commit | 97cb7deceeeeac93e583044886d8ed1966d8baf5 (patch) | |
tree | 42b430ea7e315646ffd1ba693818db8363aec6cc /ui/jquery.ui.menu.js | |
parent | eaec319df315cfa80f3e36a9462691636ed540f2 (diff) | |
download | jquery-ui-97cb7deceeeeac93e583044886d8ed1966d8baf5.tar.gz jquery-ui-97cb7deceeeeac93e583044886d8ed1966d8baf5.zip |
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
Diffstat (limited to 'ui/jquery.ui.menu.js')
-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 ) ) ) { |