mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
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
This commit is contained in:
parent
04347e5a0d
commit
9a4eecdf85
9
ui/jquery.ui.autocomplete.js
vendored
9
ui/jquery.ui.autocomplete.js
vendored
@ -229,6 +229,10 @@ $.widget( "ui.autocomplete", {
|
|||||||
|
|
||||||
search: function( value, event ) {
|
search: function( value, event ) {
|
||||||
value = value != null ? value : this.element.val();
|
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 ) {
|
if ( value.length < this.options.minLength ) {
|
||||||
return this.close( event );
|
return this.close( event );
|
||||||
}
|
}
|
||||||
@ -242,10 +246,7 @@ $.widget( "ui.autocomplete", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_search: function( value ) {
|
_search: function( value ) {
|
||||||
this.term = this.element
|
this.element.addClass( "ui-autocomplete-loading" );
|
||||||
.addClass( "ui-autocomplete-loading" )
|
|
||||||
// always save the actual value, not the one passed as an argument
|
|
||||||
.val();
|
|
||||||
|
|
||||||
this.source( { term: value }, this.response );
|
this.source( { term: value }, this.response );
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user