]> source.dussan.org Git - jquery-ui.git/commitdiff
Menu: Ignore mouseenter events while typeahead is actice 1325/head
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 27 Aug 2014 16:27:06 +0000 (13:27 -0300)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 27 Aug 2014 16:44:08 +0000 (13:44 -0300)
Prevents focusing the wrong item when typeahead causes a scroll while the mouse
is over an item in the menu.

Fixes #10458

ui/menu.js

index 479ff5a18eb70f5b1f8330d9d6cc37aecf2427f1..4dfa0d37a6e70b1360a56fdeb0eb860662a5283d 100644 (file)
@@ -101,6 +101,12 @@ return $.widget( "ui.menu", {
                                }
                        },
                        "mouseenter .ui-menu-item": function( event ) {
+                               // Ignore mouse events while typeahead is active, see #10458.
+                               // Prevents focusing the wrong item when typeahead causes a scroll while the mouse
+                               // is over an item in the menu
+                               if ( this.previousFilter ) {
+                                       return;
+                               }
                                var target = $( event.currentTarget );
                                // Remove ui-state-active class from siblings of the newly focused menu item
                                // to avoid a jump caused by adjacent elements both having a class with a border