From befb2c6a42cb48307f0da5147b16345dedd4d6be Mon Sep 17 00:00:00 2001 From: ss10 Date: Sat, 21 Oct 2023 18:59:12 +0530 Subject: [PATCH] fix: Page break on Convert to Multi Select (#1383) Co-authored-by: shruti satsangi --- packages/surveys/src/components/MultipleChoiceMultiQuestion.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/surveys/src/components/MultipleChoiceMultiQuestion.tsx b/packages/surveys/src/components/MultipleChoiceMultiQuestion.tsx index 3863ff1d1b..52f61b481c 100644 --- a/packages/surveys/src/components/MultipleChoiceMultiQuestion.tsx +++ b/packages/surveys/src/components/MultipleChoiceMultiQuestion.tsx @@ -35,7 +35,7 @@ export default function MultipleChoiceSingleQuestion({ const [otherSelected, setOtherSelected] = useState( !!value && - (value as string[]).some((item) => { + ((Array.isArray(value) ? value : [value]) as string[]).some((item) => { return getChoicesWithoutOtherLabels().includes(item) === false; }) ); // check if the value contains any string which is not in `choicesWithoutOther`, if it is there, it must be other value which make the initial value true