hotfix: mode node id can be anything > 0

This commit is contained in:
Carter 2026-07-16 14:22:33 -06:00
parent 65f8fd06d3
commit 80750bd3e9
2 changed files with 15 additions and 4 deletions

View file

@ -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" &&

View file

@ -121,10 +121,12 @@
],
"labelB": "To Node Id",
"entryB": "number",
"exclusiveMinimumB": true,
"stepB": "any",
"dictionaryB": [
{
"key": "min",
"value": 1,
"value": 0,
"restricted": false
},
{