aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.autocomplete.js
diff options
context:
space:
mode:
authorDan Wellman <danwellman@hotmail.com>2011-11-28 08:38:34 +0000
committerDan Wellman <danwellman@hotmail.com>2011-11-28 08:38:34 +0000
commita4fd5449b24b998ffa514f01b735da2b6465a80a (patch)
tree51b1c2828e85f538775e22cf5e3a930a8c4fe506 /ui/jquery.ui.autocomplete.js
parentfce4725a8ac599efab5449710550a029a2d6fbe3 (diff)
parent53ea93327e9040b7472e8fd2af2abaea19058e4a (diff)
downloadjquery-ui-a4fd5449b24b998ffa514f01b735da2b6465a80a.tar.gz
jquery-ui-a4fd5449b24b998ffa514f01b735da2b6465a80a.zip
Merge remote-tracking branch 'upstream/selectmenu' into selectmenu
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 {