]> source.dussan.org Git - jquery-ui.git/commitdiff
Menu: Don't trigger select if a click occurs outside of a menu item.
authorScott González <scott.gonzalez@gmail.com>
Sat, 20 Mar 2010 19:09:46 +0000 (15:09 -0400)
committerScott González <scott.gonzalez@gmail.com>
Sat, 20 Mar 2010 19:09:46 +0000 (15:09 -0400)
Fixes #5376 - Menu plugin fires select when border is clicked.

ui/jquery.ui.autocomplete.js

index 60ba69f89edae8c4d92a7e9d7ef76b838b6294f3..021b330a6eee34acb2319a7c2605d324fd08e960 100644 (file)
@@ -335,6 +335,9 @@ $.widget("ui.menu", {
                                "aria-activedescendant": "ui-active-menuitem"
                        })
                        .click(function(e) {
+                               if ( !$( e.target ).closest( ".ui-menu-item" ).length ) {
+                                       return;
+                               }
                                // temporary
                                e.preventDefault();
                                self.select();