]> source.dussan.org Git - jquery-ui.git/commitdiff
Autocomplete: Delay option just delays request, doesn't clear existing timeout, there...
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Sat, 24 Sep 2011 17:07:08 +0000 (19:07 +0200)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Sat, 24 Sep 2011 17:07:08 +0000 (19:07 +0200)
ui/jquery.ui.autocomplete.js

index b871715bae57ae23f3500118cbbe27b6d93c6c3a..a4bc82d28408625bb99a7b208701b2e9e4c5053a 100644 (file)
@@ -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 } );