From 23a5cb1917fa6f7fd80e8cae8d04c753c76eecbb Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Tue, 20 Apr 2021 23:39:21 +0100 Subject: [PATCH] Ensure typedInput option is selected in dropdown menu Part of #2945 --- .../@node-red/editor-client/src/js/ui/common/typedInput.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js index 63455fe17..2dbd6d71a 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js @@ -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"); }