From 80750bd3e9bf74db37c263ef7b31d16d1fb1ca7a Mon Sep 17 00:00:00 2001 From: Carter Date: Thu, 16 Jul 2026 14:22:33 -0600 Subject: [PATCH] hotfix: mode node id can be anything > 0 --- src/component/ComponentForm.tsx | 15 ++++++++++++--- src/component/ComponentMode.json | 4 +++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/component/ComponentForm.tsx b/src/component/ComponentForm.tsx index 266c402..362b0ae 100644 --- a/src/component/ComponentForm.tsx +++ b/src/component/ComponentForm.tsx @@ -503,10 +503,14 @@ export default function ComponentForm(props: Props) { }; const isOffsetValid = (min?: number, max?: number) => { - let minimum = min ?? modeDictionaryValue(compMode?.mode.dictionaryB, "min") ?? 0; - let maximum = max ?? modeDictionaryValue(compMode?.mode.dictionaryB, "max") ?? 100; + const minimum = min ?? modeDictionaryValue(compMode?.mode.dictionaryB, "min") ?? 0; + const maximum = max ?? modeDictionaryValue(compMode?.mode.dictionaryB, "max") ?? 100; if (compMode && form.component.settings.calibrate) { - return Number(form.offset) <= maximum && Number(form.offset) >= minimum; + const offset = Number(form.offset); + const meetsMinimum = compMode.mode.exclusiveMinimumB + ? offset > minimum + : offset >= minimum; + return !isNaN(offset) && offset <= maximum && meetsMinimum; } return !isNaN(Number(form.offset)); }; @@ -850,6 +854,11 @@ export default function ComponentForm(props: Props) { onFocus={selectText} margin="normal" fullWidth + inputProps={ + compMode.mode.stepB !== undefined + ? { step: compMode.mode.stepB } + : undefined + } type={compMode.mode.entryB} variant="outlined"> {compMode.mode.entryB === "select" && diff --git a/src/component/ComponentMode.json b/src/component/ComponentMode.json index da36459..4443d1f 100644 --- a/src/component/ComponentMode.json +++ b/src/component/ComponentMode.json @@ -121,10 +121,12 @@ ], "labelB": "To Node Id", "entryB": "number", + "exclusiveMinimumB": true, + "stepB": "any", "dictionaryB": [ { "key": "min", - "value": 1, + "value": 0, "restricted": false }, {