Fix bug 38847 Clear suggested text when input no longer matches
Change-Id: I6651f38830fcb54bf6b4290eeeedcf48841a8314
This commit is contained in:
committed by
Gerrit Code Review
parent
8855af1428
commit
bb4871f6e5
@@ -157,6 +157,7 @@
|
|||||||
*/
|
*/
|
||||||
resultHandler: function( query ) {
|
resultHandler: function( query ) {
|
||||||
if ( this.resultCount === 0 && this.options.noresults ) {
|
if ( this.resultCount === 0 && this.options.noresults ) {
|
||||||
|
this.$suggestion.val( '' );
|
||||||
this.options.noresults.call( this, query );
|
this.options.noresults.call( this, query );
|
||||||
} else if ( this.options.success ) {
|
} else if ( this.options.success ) {
|
||||||
this.options.success( this, query, this.resultCount );
|
this.options.success( this, query, this.resultCount );
|
||||||
@@ -176,7 +177,7 @@
|
|||||||
var autonym,
|
var autonym,
|
||||||
userInput = this.$element.val(),
|
userInput = this.$element.val(),
|
||||||
suggestion = userInput + languageName.substring( userInput.length, languageName.length );
|
suggestion = userInput + languageName.substring( userInput.length, languageName.length );
|
||||||
if ( suggestion !== languageName ) {
|
if ( suggestion.toLowerCase() !== languageName.toLowerCase() ) {
|
||||||
// see if it was autonym match
|
// see if it was autonym match
|
||||||
autonym = $.uls.data.autonym( langCode ) || '';
|
autonym = $.uls.data.autonym( langCode ) || '';
|
||||||
suggestion = userInput + autonym.substring( userInput.length, autonym.length );
|
suggestion = userInput + autonym.substring( userInput.length, autonym.length );
|
||||||
|
|||||||
Reference in New Issue
Block a user