diff --git a/src/components/pwa/MultiAnswerButtons.tsx b/src/components/pwa/MultiAnswerButtons.tsx index aab5345..c0359d5 100644 --- a/src/components/pwa/MultiAnswerButtons.tsx +++ b/src/components/pwa/MultiAnswerButtons.tsx @@ -9,9 +9,9 @@ const MultiAnswerButtons = ({ value = [], onChange, onNext, options = [] }) => { const handleClick = React.useCallback( o => () => { if (value?.find(v => v.label === o.label)) { - onChange && onChange(value.filter(v => v.label !== o.label)); + onChange && onChange([...value.filter(v => v.label !== o.label)]); } else { - onChange && onChange(value.concat(o)); + onChange && onChange([...value.concat(o)]); } }, // eslint-disable-next-line @@ -30,24 +30,42 @@ const MultiAnswerButtons = ({ value = [], onChange, onNext, options = [] }) => { const isSelected = value?.find(v => v.label === o.label) ? true : false; return ( - +