diff options
-rw-r--r-- | src/components/RsvpForm.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/RsvpForm.tsx b/src/components/RsvpForm.tsx index b9dd991..9e957f8 100644 --- a/src/components/RsvpForm.tsx +++ b/src/components/RsvpForm.tsx @@ -63,10 +63,10 @@ function RsvpForm() { }); const handleParty = () => { - const partySize = Number(watch('partySize')); + const partySize = Number(watch('partySize')) - 1; if ( partySize > previousPartySize.current && - partySize > 1 && + partySize > 0 && partySize < 10 ) { append( @@ -76,7 +76,7 @@ function RsvpForm() { }) ); previousPartySize.current = partySize; - } else if (partySize < previousPartySize.current && partySize > 0) { + } else if (partySize < previousPartySize.current && partySize >= 0) { remove( [...Array(previousPartySize.current - partySize).keys()].map( (_, i) => partySize - 1 + i |