fix: Page break on Convert to Multi Select (#1383)

Co-authored-by: shruti satsangi <shrutisatsangi@shrutis-MacBook-Air.local>
This commit is contained in:
ss10
2023-10-21 18:59:12 +05:30
committed by GitHub
parent bd90da3665
commit befb2c6a42

View File

@@ -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