From: Scott González Date: Sat, 20 Mar 2010 19:09:46 +0000 (-0400) Subject: Menu: Don't trigger select if a click occurs outside of a menu item. X-Git-Tag: 1.8.1~17 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c61bd8ec67d9a863a00ae9d188993680f83186b0;p=jquery-ui.git Menu: Don't trigger select if a click occurs outside of a menu item. Fixes #5376 - Menu plugin fires select when border is clicked. --- diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index 60ba69f89..021b330a6 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -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();