]> source.dussan.org Git - jquery-ui.git/commitdiff
Autocomplete: changed the search function to always store the last term that was...
authorRobson Braga Araujo <robsonbraga@gmail.com>
Tue, 10 Aug 2010 23:02:50 +0000 (07:02 +0800)
committerScott González <scott.gonzalez@gmail.com>
Wed, 11 Aug 2010 00:21:08 +0000 (08:21 +0800)
ui/jquery.ui.autocomplete.js

index 8380df8ad74eab282edcf4ac97aa7e5cd60df6b5..4cd1b0548aaeb2389712c89b9f8d42d7171a3b27 100644 (file)
@@ -229,6 +229,10 @@ $.widget( "ui.autocomplete", {
 
        search: function( value, event ) {
                value = value != null ? value : this.element.val();
+
+               // always save the actual value, not the one passed as an argument
+               this.term = this.element.val();
+
                if ( value.length < this.options.minLength ) {
                        return this.close( event );
                }
@@ -242,10 +246,7 @@ $.widget( "ui.autocomplete", {
        },
 
        _search: function( value ) {
-               this.term = this.element
-                       .addClass( "ui-autocomplete-loading" )
-                       // always save the actual value, not the one passed as an argument
-                       .val();
+               this.element.addClass( "ui-autocomplete-loading" );
 
                this.source( { term: value }, this.response );
        },