Skip to content

Commit

Permalink
Form/number input parses as float, not int
Browse files Browse the repository at this point in the history
  • Loading branch information
jsloat committed Jun 18, 2024
1 parent b7b332d commit b95fd35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/input/form/fieldRows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ export const NumberField = (opts: NumberOpts) => {
...(isNumber(currValue) && { initValue: String(currValue) }),
placeholder: isNumber(currValue) ? String(currValue) : '42',
});
const parsed = newVal && Number.parseInt(newVal);
const parsed = newVal && Number.parseFloat(newVal);
if (isNumber(parsed) && parsed !== currValue) onChange(parsed);
},
isFaded: !isNumber(currValue),
Expand Down

0 comments on commit b95fd35

Please sign in to comment.