Skip to content
Permalink
Browse files
Autocomplete: changed the search function to always store the last te…
…rm 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
  • Loading branch information
galo2099 authored and scottgonzalez committed Aug 11, 2010
1 parent 04347e5 commit 9a4eecd
Showing 1 changed file with 5 additions and 4 deletions.
@@ -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 );
},

1 comment on commit 9a4eecd

@scottgonzalez
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@galo2099 Can you please sign our CLA?

Please sign in to comment.