aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ui/jquery.ui.autocomplete.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js
index 8380df8ad..4cd1b0548 100644
--- a/ui/jquery.ui.autocomplete.js
+++ b/ui/jquery.ui.autocomplete.js
@@ -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 );
},