From 439af2a32580f0cf71d207fa08776b0db9074d39 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Tue, 12 Oct 2021 17:18:02 +0100 Subject: [PATCH] Fix rule focus when switch 'otherwise' rule is used Fixes #3182 --- .../node_modules/@node-red/nodes/core/function/10-switch.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/node_modules/@node-red/nodes/core/function/10-switch.html b/packages/node_modules/@node-red/nodes/core/function/10-switch.html index 54ca33e0f..1f86fbc3c 100644 --- a/packages/node_modules/@node-red/nodes/core/function/10-switch.html +++ b/packages/node_modules/@node-red/nodes/core/function/10-switch.html @@ -351,7 +351,9 @@ } else { selectField.width("auto") } - fieldToFocus.typedInput("focus"); + if (fieldToFocus) { + fieldToFocus.typedInput("focus"); + } // Preselect the contents of the element // if (focusValueField && document.activeElement) { // document.activeElement.selectionStart = 0;