From d3800991162ed281dc811552747494df012cfd49 Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 20 Sep 2010 09:27:32 -0400 Subject: Autocomplete: Properly handle non-item clicks inside the suggestion list. Fixes #6052 - Autocomplete suggestion list does not close properly. --- ui/jquery.ui.autocomplete.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index 6cdbb4db7..176f81e0a 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -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 ] && -- cgit v1.2.3