Skip to content

Commit

Permalink
Fix duplicated onChange prop
Browse files Browse the repository at this point in the history
  • Loading branch information
scastiel committed Feb 28, 2024
1 parent 25dd99e commit 54501af
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/components/expense-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export function ExpenseForm({
<FormField
control={form.control}
name="amount"
render={({ field }) => (
render={({ field: { onChange, ...field } }) => (
<FormItem className="sm:order-3">
<FormLabel>Amount</FormLabel>
<div className="flex items-baseline gap-2">
Expand All @@ -235,9 +235,7 @@ export function ExpenseForm({
step={0.01}
placeholder="0.00"
onChange={(event) =>
field.onChange(
enforceCurrencyPattern(event.target.value),
)
onChange(enforceCurrencyPattern(event.target.value))
}
onClick={(e) => e.currentTarget.select()}
{...field}
Expand Down

0 comments on commit 54501af

Please sign in to comment.