From 95e3611cd3382a1db428ad16227bc2c0a6a12981 Mon Sep 17 00:00:00 2001 From: Tacodiva <27910867+Tacodiva@users.noreply.github.com> Date: Mon, 28 Aug 2023 13:03:51 +1000 Subject: [PATCH] Allow number inputs to contain empty strings. --- addons/middle-click-popup/BlockTypeInfo.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/middle-click-popup/BlockTypeInfo.js b/addons/middle-click-popup/BlockTypeInfo.js index c737ba35a9..5a95528707 100644 --- a/addons/middle-click-popup/BlockTypeInfo.js +++ b/addons/middle-click-popup/BlockTypeInfo.js @@ -134,6 +134,7 @@ export class BlockInputNumber extends BlockInputRound { const type = typeof value; if (type === "number") return value; if (type === "string") { + if (value.length === 0) return value; const number = parseFloat(value); if (isNaN(number)) throw new Error('Cannot set numeric type input to string "' + value + '".'); return value;