aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.autocomplete.js
diff options
context:
space:
mode:
authorRobson Braga Araujo <robsonbraga@gmail.com>2010-08-11 07:02:50 +0800
committerScott González <scott.gonzalez@gmail.com>2010-08-11 08:21:08 +0800
commit9a4eecdf85bf0a3accd7acb9fead64d6b5aad18e (patch)
treeae304a3786c79ff7b34c2f7bb47bafc9b3d2cd6c /ui/jquery.ui.autocomplete.js
parent04347e5a0daadf021995328616102816fb8b2d4c (diff)
downloadjquery-ui-9a4eecdf85bf0a3accd7acb9fead64d6b5aad18e.tar.gz
jquery-ui-9a4eecdf85bf0a3accd7acb9fead64d6b5aad18e.zip
Autocomplete: changed the search function to always store the last term that was entered by the user. Fixed #5922 - autocomplete: Search not triggered if the first letter is the same as the first letter of a previous erased content
Diffstat (limited to 'ui/jquery.ui.autocomplete.js')
-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 );
},