ui: fix array was checked for single select option (#823)

This commit is contained in:
panda authored and GitHub committed 2024-06-07 04:38:58 +08:00
1 parent d802a81a45
commit 1c8a6ee9ab
1 file changed
+3 -2
@@ -261,9 +261,10 @@ const page = new NamedPage(['problem_detail', 'contest_detail_problem', 'homewor
for (const v of val) {
if (isValidOption(v)) $(`.objective_${id} input[value="${v}"]`).prop('checked', true);
}
} else {
$(`.objective_${id} input[type=text], .objective_${id} textarea`).val(val);
if (isValidOption(val)) $(`.objective_${id}.radiobox [value="${val}"]`).prop('checked', true);
}
$(`.objective_${id} input[type=text], .objective_${id} textarea`).val(val);
if (isValidOption(val)) $(`.objective_${id}.radiobox [value="${val}"]`).prop('checked', true);
}
}