summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/src/components/RsvpForm.tsx3
1 files changed, 3 insertions, 0 deletions
diff --git a/client/src/components/RsvpForm.tsx b/client/src/components/RsvpForm.tsx
index d981053..4454c77 100644
--- a/client/src/components/RsvpForm.tsx
+++ b/client/src/components/RsvpForm.tsx
@@ -131,6 +131,7 @@ function RsvpForm() {
helperText={errors.email?.message}
required
{...register('email', {
+ setValueAs: (value: string) => value.trim(),
required: 'This field is required',
pattern: {
value: /\S+@\S+\.\S+/,
@@ -191,6 +192,7 @@ function RsvpForm() {
helperText={errors.partyList?.[index]?.firstName?.message}
required
{...register(`partyList.${index}.firstName`, {
+ setValueAs: (value: string) => value.trim(),
required: 'This field is required',
})}
/>
@@ -204,6 +206,7 @@ function RsvpForm() {
helperText={errors.partyList?.[index]?.lastName?.message}
required
{...register(`partyList.${index}.lastName`, {
+ setValueAs: (value: string) => value.trim(),
required: 'This field is required',
})}
/>