Skip to content

Commit

Permalink
Convert empty email string to null instead of undefined (#1492)
Browse files Browse the repository at this point in the history
final-form automatically converts "" -> undefined. Explicitly work around this to use null instead.

The API treats nulls as null values
and undefined as unchanged or omitted values
  • Loading branch information
CarsonF authored Oct 31, 2023
1 parent 24660d0 commit e72c17c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/components/form/EmailField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const EmailField = ({
required={required}
{...rest}
inputMode="email"
parse={(v) => v || null}
replace={(v) => (caseSensitive ? v : v.toLowerCase())}
/>
);

0 comments on commit e72c17c

Please sign in to comment.