diff --git a/packages/client/src/components/Component.svelte b/packages/client/src/components/Component.svelte index 7b87040c4f..f80cd80c00 100644 --- a/packages/client/src/components/Component.svelte +++ b/packages/client/src/components/Component.svelte @@ -153,7 +153,7 @@ $: builderInteractive = $builderStore.inBuilder && insideScreenslot && !isBlock && !instance.static $: devToolsInteractive = $devToolsStore.allowSelection && !isBlock - $: interactive = !isRoot && (builderInteractive || devToolsInteractive) + $: interactive = builderInteractive || devToolsInteractive $: editing = editable && selected && $builderStore.editMode $: draggable = !inDragPath && @@ -231,6 +231,7 @@ empty: emptyState, selected, interactive, + isRoot, draggable, editable, isBlock, @@ -672,6 +673,7 @@ class:parent={hasChildren} class:block={isBlock} class:error={errorState} + class:root={isRoot} data-id={id} data-name={name} data-icon={icon} diff --git a/packages/client/src/components/preview/HoverIndicator.svelte b/packages/client/src/components/preview/HoverIndicator.svelte index d204d77f49..f1c151ce16 100644 --- a/packages/client/src/components/preview/HoverIndicator.svelte +++ b/packages/client/src/components/preview/HoverIndicator.svelte @@ -19,7 +19,7 @@ newId = e.target.dataset.id } else { // Handle normal components - const element = e.target.closest(".interactive.component") + const element = e.target.closest(".interactive.component:not(.root)") newId = element?.dataset?.id } diff --git a/packages/client/src/utils/styleable.js b/packages/client/src/utils/styleable.js index 0f484a9ab9..884420a1fd 100644 --- a/packages/client/src/utils/styleable.js +++ b/packages/client/src/utils/styleable.js @@ -93,7 +93,7 @@ export const styleable = (node, styles = {}) => { node.addEventListener("mouseout", applyNormalStyles) // Add builder preview click listener - if (newStyles.interactive) { + if (newStyles.interactive && !newStyles.isRoot) { node.addEventListener("click", selectComponent, false) node.addEventListener("dblclick", editComponent, false) }