Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Autocomplete: Properly handle non-item clicks inside the suggestion l…

…ist. Fixes #6052 - Autocomplete suggestion list does not close properly.
  • Loading branch information...
commit d3800991162ed281dc811552747494df012cfd49 1 parent 98a98a0
@scottgonzalez scottgonzalez authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  ui/jquery.ui.autocomplete.js
View
2  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 ] &&
Please sign in to comment.
Something went wrong with that request. Please try again.