Show component hidden by conditional UI if they would otherwise hide the selected component

This commit is contained in:
Andrew Kingston 2021-08-23 14:01:57 +01:00
parent 4a67de926a
commit 796dc24b06
1 changed files with 2 additions and 2 deletions

View File

@ -63,6 +63,7 @@
$: selected = $: selected =
$builderStore.inBuilder && $builderStore.inBuilder &&
$builderStore.selectedComponentId === instance._id $builderStore.selectedComponentId === instance._id
$: inSelectedPath = $builderStore.selectedComponentPath?.includes(id)
$: interactive = $builderStore.previewType === "layout" || insideScreenslot $: interactive = $builderStore.previewType === "layout" || insideScreenslot
$: evaluateConditions(enrichedSettings?._conditions) $: evaluateConditions(enrichedSettings?._conditions)
$: componentSettings = { ...enrichedSettings, ...conditionalSettings } $: componentSettings = { ...enrichedSettings, ...conditionalSettings }
@ -174,13 +175,12 @@
</script> </script>
{#key propsHash} {#key propsHash}
{#if constructor && componentSettings && visible} {#if constructor && componentSettings && (visible || inSelectedPath)}
<div <div
class={`component ${id}`} class={`component ${id}`}
data-type={interactive ? "component" : ""} data-type={interactive ? "component" : ""}
data-id={id} data-id={id}
data-name={name} data-name={name}
class:hidden={!visible}
> >
<svelte:component this={constructor} {...componentSettings}> <svelte:component this={constructor} {...componentSettings}>
{#if children.length} {#if children.length}