]> source.dussan.org Git - jquery-ui.git/commitdiff
Autocomplete: Properly handle non-item clicks inside the suggestion list. Fixes ...
authorScott González <scott.gonzalez@gmail.com>
Mon, 20 Sep 2010 13:27:32 +0000 (09:27 -0400)
committerScott González <scott.gonzalez@gmail.com>
Mon, 20 Sep 2010 13:27:32 +0000 (09:27 -0400)
ui/jquery.ui.autocomplete.js

index 6cdbb4db7b3d22c0f72b935851cfebe29e45f083..176f81e0a14aed6aa2a69486b6c2dd0f88fef0c5 100644 (file)
@@ -125,7 +125,7 @@ $.widget( "ui.autocomplete", {
                                // so we have to track the next mousedown and close the menu if
                                // the user clicks somewhere outside of the autocomplete
                                var menuElement = self.menu.element[ 0 ];
-                               if ( event.target === menuElement ) {
+                               if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
                                        setTimeout(function() {
                                                $( document ).one( 'mousedown', function( event ) {
                                                        if ( event.target !== self.element[ 0 ] &&