From 5585f02cad0c737f99c16433d7a61f3a5f3743d3 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 12 Dec 2023 03:41:23 +0100 Subject: [PATCH] Fix: make sure that a 'hidden' tagRendering cannot be accidentally selected --- src/UI/Popup/TagRendering/TagRenderingQuestion.svelte | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/UI/Popup/TagRendering/TagRenderingQuestion.svelte b/src/UI/Popup/TagRendering/TagRenderingQuestion.svelte index 533578990..10fc17fbd 100644 --- a/src/UI/Popup/TagRendering/TagRenderingQuestion.svelte +++ b/src/UI/Popup/TagRendering/TagRenderingQuestion.svelte @@ -40,6 +40,9 @@ // Will be bound if a freeform is available let freeformInput = new UIEventSource(tags?.[config.freeform?.key]); let selectedMapping: number = undefined; + /** + * A list of booleans, used if multiAnswer is set + */ let checkedMappings: boolean[]; let mappings: Mapping[] = config?.mappings; @@ -72,12 +75,15 @@ checkedMappings?.length < confg.mappings.length + (confg.freeform ? 1 : 0)) ) { const seenFreeforms = []; - TagUtils.FlattenMultiAnswer(); + // Initial setup of the mappings checkedMappings = [ ...confg.mappings.map((mapping) => { + if(mapping.hideInAnswer === true){ + return false + } const matches = TagUtils.MatchesMultiAnswer(mapping.if, tgs); if (matches && confg.freeform) { - const newProps = TagUtils.changeAsProperties(mapping.if.asChange()); + const newProps = TagUtils.changeAsProperties(mapping.if.asChange({})); seenFreeforms.push(newProps[confg.freeform.key]); } return matches;