From 4b800c849bf103bcaf6a154528cbc15edb713943 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 29 Apr 2025 19:43:54 -0400 Subject: [PATCH] fix: improve array handling throughout RSVPForm component --- frontend/src/components/RSVPForm.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/RSVPForm.tsx b/frontend/src/components/RSVPForm.tsx index 505c421..3d61861 100644 --- a/frontend/src/components/RSVPForm.tsx +++ b/frontend/src/components/RSVPForm.tsx @@ -73,9 +73,10 @@ const RSVPForm: React.FC = () => { const handleItemsChange = (e: SelectChangeEvent) => { const { value } = e.target; + const newValue = typeof value === 'string' ? value.split(',') : value; setFormData(prev => ({ ...prev, - items_bringing: Array.isArray(value) ? value : value.split(',').filter(Boolean), + items_bringing: Array.isArray(newValue) ? newValue : [], })); }; @@ -202,25 +203,25 @@ const RSVPForm: React.FC = () => { )}