fix: other option not working in multiSelect multi question (#2607)

This commit is contained in:
Dhruwang Jariwala
2024-05-10 19:24:23 +05:30
committed by GitHub
parent c282f630c4
commit 3c91dd52a0

View File

@@ -227,10 +227,9 @@ export const MultipleChoiceMultiQuestion = ({
value={getLocalizedValue(otherOption.label, languageCode)}
className="border-brand text-brand h-4 w-4 border focus:ring-0 focus:ring-offset-0"
aria-labelledby={`${otherOption.id}-label`}
onChange={(e) => {
onChange={() => {
setOtherSelected(!otherSelected);
if ((e.target as HTMLInputElement)?.checked) {
if (!otherValue) return;
if (!value.includes(otherValue)) {
addItem(otherValue);
} else {
removeItem(otherValue);