Ensure only the selected block supports clicking on inner interactive components

This commit is contained in:
Andrew Kingston 2023-09-05 11:11:43 +01:00
parent 43663c6fbf
commit bffa8b1f0f
1 changed files with 2 additions and 1 deletions

View File

@ -26,6 +26,7 @@
$: id = `${block.id}-${context ?? rand}`
$: parentId = $component?.id
$: inBuilder = $builderStore.inBuilder
$: blockSelected = $builderStore.selectedComponentId === block.id
$: instance = {
...props,
_component: getComponent(type),
@ -77,6 +78,6 @@
})
</script>
<Component {instance} isBlock {onClick}>
<Component {instance} isBlock onClick={blockSelected ? onClick : null}>
<slot />
</Component>