Skip to content

Commit

Permalink
Fix "number" input type parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-bures committed Mar 3, 2024
1 parent 259ee70 commit 6b21fb7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/mission/inputs/TextInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ export default function TextInput({name, label, value, onChange, type = "text",
<Textarea
name={name}
value={value}
onChange={e => onChange(name, e.target.value)}
onChange={e =>
onChange(name, type === "number" ? parseFloat(e.target.value) : e.target.value)}
/>
) : (
<Input
type={type}
name={name}
value={value}
onChange={e => onChange(name, e.target.value)}
onChange={e =>
onChange(name, type === "number" ? parseFloat(e.target.value) : e.target.value)}
/>
)}
</FormControl>
Expand Down

0 comments on commit 6b21fb7

Please sign in to comment.