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 10, 2010
1 parent 04347e5 commit 9a4eecdf85bf0a3accd7acb9fead64d6b5aad18e
Showing with 5 additions and 4 deletions.
  1. +5 −4 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 );
},

1 comment on commit 9a4eecd

@scottgonzalez

This comment has been minimized.

Copy link
Member

scottgonzalez commented on 9a4eecd Dec 10, 2013

@galo2099 Can you please sign our CLA?

Please sign in to comment.
You can’t perform that action at this time.