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

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");
}