Skip to content

Commit d380099

Browse files
committed
Autocomplete: Properly handle non-item clicks inside the suggestion list. Fixes #6052 - Autocomplete suggestion list does not close properly.
1 parent 98a98a0 commit d380099

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ui/jquery.ui.autocomplete.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ $.widget( "ui.autocomplete", {
125125
// so we have to track the next mousedown and close the menu if
126126
// the user clicks somewhere outside of the autocomplete
127127
var menuElement = self.menu.element[ 0 ];
128-
if ( event.target === menuElement ) {
128+
if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
129129
setTimeout(function() {
130130
$( document ).one( 'mousedown', function( event ) {
131131
if ( event.target !== self.element[ 0 ] &&

0 commit comments

Comments
 (0)