1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

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

View File

@ -443,7 +443,11 @@
}); });
this._showMenu(this.optionMenu,this.optionSelectTrigger); 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) { if (selectedOption.length === 0) {
selectedOption = this.optionMenu.children(":first"); selectedOption = this.optionMenu.children(":first");
} }