aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2010-09-20 09:27:32 -0400
committerScott González <scott.gonzalez@gmail.com>2010-09-20 09:27:32 -0400
commitd3800991162ed281dc811552747494df012cfd49 (patch)
tree560241ab1b7f91964adaeb787e65719f05accf24
parent98a98a05d1a646a1e53b90020fe7c096acd1d933 (diff)
downloadjquery-ui-d3800991162ed281dc811552747494df012cfd49.tar.gz
jquery-ui-d3800991162ed281dc811552747494df012cfd49.zip
Autocomplete: Properly handle non-item clicks inside the suggestion list. Fixes #6052 - Autocomplete suggestion list does not close properly.
-rw-r--r--ui/jquery.ui.autocomplete.js2
1 files changed, 1 insertions, 1 deletions
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 ] &&