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;