Skip to content

Commit

Permalink
fix bug where form editor can trigger unneeded editor change (#1564)
Browse files Browse the repository at this point in the history
  • Loading branch information
joswig authored Nov 21, 2024
1 parent 46512d8 commit abf6687
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/sequencing/form/NumEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
let max: number = Infinity;
let min: number = -Infinity;
let value: number;
let value: number | null = initVal;
let valFloat: number = Number(value);
$: max = argDef.range?.max ?? Infinity;
$: min = argDef.range?.min ?? (isFswCommandArgumentUnsigned(argDef) ? 0 : -Infinity);
$: value = initVal;
$: valFloat = Number(value);
$: {
if (typeof value === 'number' && !isNaN(valFloat)) {
if (typeof value === 'number' && !isNaN(valFloat) && initVal !== value) {
setInEditor(value);
}
}
Expand Down

0 comments on commit abf6687

Please sign in to comment.