From cd76c934b61e79318ca57acc5fe58c8b359922e7 Mon Sep 17 00:00:00 2001 From: Kazuhito Yokoi Date: Sun, 2 Jul 2023 00:40:15 +0900 Subject: [PATCH 1/2] Fix broken text input in the switch node --- .../@node-red/nodes/core/function/10-switch.html | 5 +++++ 1 file changed, 5 insertions(+) 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 ebe22d65c..78cfa0793 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 @@ -103,6 +103,11 @@ } else if (type === "istype") { r.v = rule.find(".node-input-rule-type-value").typedInput('type'); r.vt = rule.find(".node-input-rule-type-value").typedInput('type'); + if (r.vt === "number") { + r.vt = "num"; + } else { + r.vt = "str"; + } } else if (type === "jsonata_exp") { r.v = rule.find(".node-input-rule-exp-value").typedInput('value'); r.vt = rule.find(".node-input-rule-exp-value").typedInput('type'); From 18e1b670ca6f32941783a0056bc23b2ca0bc51e1 Mon Sep 17 00:00:00 2001 From: Kazuhito Yokoi Date: Sun, 2 Jul 2023 01:33:11 +0900 Subject: [PATCH 2/2] Make handlings one line --- .../@node-red/nodes/core/function/10-switch.html | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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 78cfa0793..c10a53827 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 @@ -103,11 +103,7 @@ } else if (type === "istype") { r.v = rule.find(".node-input-rule-type-value").typedInput('type'); r.vt = rule.find(".node-input-rule-type-value").typedInput('type'); - if (r.vt === "number") { - r.vt = "num"; - } else { - r.vt = "str"; - } + r.vt = (r.vt === "number") ? "num" : "str"; } else if (type === "jsonata_exp") { r.v = rule.find(".node-input-rule-exp-value").typedInput('value'); r.vt = rule.find(".node-input-rule-exp-value").typedInput('type');