aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.autocomplete.js
diff options
context:
space:
mode:
authorShannon <spekary@gmail.com>2011-11-23 13:39:45 -0500
committerScott González <scott.gonzalez@gmail.com>2011-11-23 13:39:45 -0500
commit2445e20a856192179590c0d08e5d73479df1e52d (patch)
tree3262e0c31528d61b9ced8c38e71c924f34ea5a6b /ui/jquery.ui.autocomplete.js
parent54fb1441fe2f9595a8376b9f4bf7d766469f5045 (diff)
downloadjquery-ui-2445e20a856192179590c0d08e5d73479df1e52d.tar.gz
jquery-ui-2445e20a856192179590c0d08e5d73479df1e52d.zip
Autocomplete: Making sure we do not show search menu after a blur. Fixed #7423 - Tab out of autocomplete with remote source can leave menu showing.
Diffstat (limited to 'ui/jquery.ui.autocomplete.js')
-rw-r--r--ui/jquery.ui.autocomplete.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js
index 9871b52d7..dbda2058e 100644
--- a/ui/jquery.ui.autocomplete.js
+++ b/ui/jquery.ui.autocomplete.js
@@ -184,6 +184,7 @@ $.widget( "ui.autocomplete", {
}
clearTimeout( self.searching );
+ self.cancelSearch = true;
// clicks on the menu (or a button to trigger a search) will cause a blur event
self.closing = setTimeout(function() {
self.close( event );
@@ -373,6 +374,7 @@ $.widget( "ui.autocomplete", {
_search: function( value ) {
this.pending++;
this.element.addClass( "ui-autocomplete-loading" );
+ this.cancelSearch = false;
this.source( { term: value }, this.response );
},
@@ -382,7 +384,7 @@ $.widget( "ui.autocomplete", {
content = this._normalize( content );
}
this._trigger( "response", null, { content: content } );
- if ( !this.options.disabled && content && content.length ) {
+ if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
this._suggest( content );
this._trigger( "open" );
} else {