Ensure typedInput option is selected in dropdown menu

Part of #2945
This commit is contained in:
Nick O'Leary 2021-04-20 23:39:21 +01:00
parent f8d5fef3c4
commit 23a5cb1917
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
1 changed files with 5 additions and 1 deletions

View File

@ -443,7 +443,11 @@
});
this._showMenu(this.optionMenu,this.optionSelectTrigger);
var selectedOption = this.optionMenu.find("[value='"+this.optionValue+"']");
var targetValue = this.optionValue;
if (this.optionValue === null || this.optionValue === undefined) {
targetValue = this.value();
}
var selectedOption = this.optionMenu.find("[value='"+targetValue+"']");
if (selectedOption.length === 0) {
selectedOption = this.optionMenu.children(":first");
}