Fix Bug 39829 - Language Selection does not work while using Language Code
This happens when you type language code and hit enter very fast, without a pause. A matched language is not available when enter is hit, so it goes noop. Handled this special case by checking whether the input is a valid language code and calling onselect on it. Change-Id: Icaf809f8db8162264d990247a164449b02b2f418
This commit is contained in:
@@ -70,8 +70,16 @@
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
if ( this.options.onSelect && this.selectedLanguage ) {
|
||||
if ( !this.options.onSelect ) {
|
||||
break;
|
||||
}
|
||||
if ( this.selectedLanguage ) {
|
||||
// this.selectLanguage will be populated from a matching search
|
||||
this.options.onSelect( this.selectedLanguage );
|
||||
} else if ( this.options.languages[this.$element.val()] ) {
|
||||
// Search is yet to happen(in timeout delay),
|
||||
// but we have a matching language code.
|
||||
this.options.onSelect( this.$element.val() );
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user