From d5769dccd1b769d09a86df45f284f80e0f6dd691 Mon Sep 17 00:00:00 2001 From: Starstrike Date: Tue, 29 Apr 2025 20:09:10 -0400 Subject: [PATCH] Fix array handling in RSVPForm items selection --- frontend/src/components/RSVPForm.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/RSVPForm.tsx b/frontend/src/components/RSVPForm.tsx index 5a47fe9..a827185 100644 --- a/frontend/src/components/RSVPForm.tsx +++ b/frontend/src/components/RSVPForm.tsx @@ -73,10 +73,11 @@ const RSVPForm: React.FC = () => { }; const handleItemsChange = (e: SelectChangeEvent) => { - const { value } = e.target; + const value = e.target.value; + const itemsArray = Array.isArray(value) ? value : typeof value === 'string' ? [value] : []; setFormData(prev => ({ ...prev, - items_bringing: Array.isArray(value) ? value : typeof value === 'string' ? value.split(',') : [], + items_bringing: itemsArray })); }; @@ -203,16 +204,15 @@ const RSVPForm: React.FC = () => {