fix: multi-select custom answer toggling

This commit is contained in:
Erik Kotsiuba
2026-05-03 22:13:30 +02:00
parent f86f3a578e
commit 780aac24cf
7 changed files with 112 additions and 11 deletions
+3 -3
View File
@@ -88,7 +88,7 @@ function buildOptionRowModel(
const answer = getAnswer(state, question.id);
const selected = index === state.activeOptionIndex;
const answered = option.isCustomOption
? !!answer?.customText
? !!(answer?.customSelected && answer.customText?.trim())
: isOptionSelected(answer, option.value);
const pointer = getOptionPointer(option, selected);
return {
@@ -180,10 +180,10 @@ function getPreviewLayout(
function getOptionPrefix(
questionType: QuestionRenderContext["question"]["type"],
option: AskDisplayOption,
_option: AskDisplayOption,
answered: boolean
): string {
if (questionType !== "multi" || option.isCustomOption) {
if (questionType !== "multi") {
return "";
}
return `[${answered ? "x" : " "}] `;