mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Autocomplete: Properly handle non-item clicks inside the suggestion list. Fixes #6052 - Autocomplete suggestion list does not close properly.
This commit is contained in:
parent
98a98a05d1
commit
d380099116
2
ui/jquery.ui.autocomplete.js
vendored
2
ui/jquery.ui.autocomplete.js
vendored
@ -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 ] &&
|
||||
|
Loading…
Reference in New Issue
Block a user