aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2011-09-24 19:07:08 +0200
committerJörn Zaefferer <joern.zaefferer@gmail.com>2011-09-24 19:07:08 +0200
commitcf3e655be19c6a64d21c494a2adbba6526cb6e86 (patch)
tree81c5c981fe4ba4a4982cf2182f1b65c12b62566a
parentbf51b0e71c8b81bea937a8b49be4c8186d25b181 (diff)
downloadjquery-ui-cf3e655be19c6a64d21c494a2adbba6526cb6e86.tar.gz
jquery-ui-cf3e655be19c6a64d21c494a2adbba6526cb6e86.zip
Autocomplete: Delay option just delays request, doesn't clear existing timeout, therefore not preventing unncessary requests. Calling abort() on existing requests has no effect for JSONP, but even then its unncessary to start a request if the user is still typing. Works fine in 1-8-stable.
-rw-r--r--ui/jquery.ui.autocomplete.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js
index b871715ba..a4bc82d28 100644
--- a/ui/jquery.ui.autocomplete.js
+++ b/ui/jquery.ui.autocomplete.js
@@ -325,6 +325,7 @@ $.widget( "ui.autocomplete", {
_searchTimeout: function( event ) {
var self = this;
+ clearTimeout( self.searching );
self.searching = setTimeout(function() {
// only search if the value has changed
if ( self.term != self.element.val() ) {
@@ -384,7 +385,7 @@ $.widget( "ui.autocomplete", {
this._trigger( "close", event );
}
},
-
+
_change: function( event ) {
if ( this.previous !== this._value() ) {
this._trigger( "change", event, { item: this.selectedItem } );