]> source.dussan.org Git - jquery-ui.git/commitdiff
Menu: Remove close delay for keyboard interaction to fix an issue with properly addin...
authorkborchers <kris.borchers@gmail.com>
Wed, 9 May 2012 04:53:14 +0000 (23:53 -0500)
committerkborchers <kris.borchers@gmail.com>
Wed, 9 May 2012 04:53:14 +0000 (23:53 -0500)
ui/jquery.ui.menu.js

index bcefd582294e4c577b1fe9e5a688fb034c24823a..8956d64043f990a0e9f0239e72fe177187e3a6e0 100644 (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 ) ) ) {