Skip to content

Commit

Permalink
Support floats in number fields
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdrackett authored and sachaw committed Apr 30, 2024
1 parent 6ab4375 commit 5fdd07e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Form/FormInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ export function GenericInput<T extends FieldValues>({
<Input
type={field.type}
step={field.properties?.step}
value={field.type === "number" ? Number.parseInt(value) : value}
value={field.type === "number" ? Number.parseFloat(value) : value}
onChange={(e) =>
onChange(
field.type === "number"
? Number.parseInt(e.target.value)
? Number.parseFloat(e.target.value)
: e.target.value,
)
}
Expand Down

0 comments on commit 5fdd07e

Please sign in to comment.