Fix general and usability issues, add some more features

* Scoll to currently highlighted item if its not visible.
* Fix navigation when list is filtered
* Add support for selecting highlighted item by pressing enter
This commit is contained in:
Abijeet
2022-12-16 20:13:53 +05:30
committed by Niklas Laxström
parent 31bd5c43db
commit 453cc37341
2 changed files with 44 additions and 19 deletions

View File

@@ -106,7 +106,10 @@
query = ( this.$element.val() || '' ).trim().toLowerCase();
if ( this.selectedLanguage ) {
var highlightedLanguage = this.options.lcd.getHighlightedLanguageCode();
if ( highlightedLanguage ) {
this.options.onSelect( highlightedLanguage, e );
} else if ( this.selectedLanguage ) {
// this.selectLanguage will be populated from a matching search
this.options.onSelect( this.selectedLanguage, e );
} else if ( this.options.languages[ query ] ) {