From e72c17cdc4722fa3ed791b0a82c35c65c3dcc512 Mon Sep 17 00:00:00 2001 From: Carson Full Date: Tue, 31 Oct 2023 12:42:12 -0500 Subject: [PATCH] Convert empty email string to null instead of undefined (#1492) 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 --- src/components/form/EmailField.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/form/EmailField.tsx b/src/components/form/EmailField.tsx index 8967a057a0..a0891fd7b4 100644 --- a/src/components/form/EmailField.tsx +++ b/src/components/form/EmailField.tsx @@ -31,6 +31,7 @@ export const EmailField = ({ required={required} {...rest} inputMode="email" + parse={(v) => v || null} replace={(v) => (caseSensitive ? v : v.toLowerCase())} /> );