Public Access
fix: use Array.isArray guard instead of unsafe cast in MultipleSelect
This commit is contained in:
1 parent
535434421a
commit
2a59f13870
1 file changed
+1
-1
@@ -15,7 +15,7 @@ export default function MultipleSelect({ q, value, onChange, locked, graded }: P
|
|||||||
if (locked) return
|
if (locked) return
|
||||||
onChange(current.includes(id) ? current.filter((v) => v !== id) : [...current, id])
|
onChange(current.includes(id) ? current.filter((v) => v !== id) : [...current, id])
|
||||||
}
|
}
|
||||||
const answerSet = new Set((q.answer as string[]) ?? [])
|
const answerSet = new Set(Array.isArray(q.answer) ? q.answer : [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="choices">
|
<div className="choices">
|
||||||
|
|||||||
Reference in new issue
Block a user