diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte
index 5c46161577..fb9117832f 100644
--- a/packages/client/src/components/ClientApp.svelte
+++ b/packages/client/src/components/ClientApp.svelte
@@ -105,7 +105,10 @@
{#key $screenStore.activeLayout._id}
-
+
{/key}
diff --git a/packages/client/src/components/Component.svelte b/packages/client/src/components/Component.svelte
index 20d8b53609..414d87a0aa 100644
--- a/packages/client/src/components/Component.svelte
+++ b/packages/client/src/components/Component.svelte
@@ -11,6 +11,8 @@
import Placeholder from "components/app/Placeholder.svelte"
export let instance = {}
+ export let isLayout = false
+ export let isScreen = false
// The enriched component settings
let enrichedSettings
@@ -178,7 +180,8 @@
data-type={interactive ? "component" : ""}
data-id={id}
data-name={name}
- data-droppable={definition?.hasChildren || false}
+ data-draggable={interactive && !isLayout && !isScreen ? "true" : "false"}
+ data-droppable={definition?.hasChildren ? "true" : "false"}
>
{#if children.length}
@@ -197,7 +200,7 @@
.component {
display: contents;
}
- .component > :global(*:hover) {
+ [data-draggable="true"] {
cursor: pointer;
}
diff --git a/packages/client/src/components/Screen.svelte b/packages/client/src/components/Screen.svelte
index a759119320..4878df157f 100644
--- a/packages/client/src/components/Screen.svelte
+++ b/packages/client/src/components/Screen.svelte
@@ -22,6 +22,6 @@
{#key screenDefinition?._id}
-
+
{/key}
diff --git a/packages/client/src/utils/styleable.js b/packages/client/src/utils/styleable.js
index 32171b9478..27f6c6a0f6 100644
--- a/packages/client/src/utils/styleable.js
+++ b/packages/client/src/utils/styleable.js
@@ -23,7 +23,11 @@ export const styleable = (node, styles = {}) => {
let applyHoverStyles
let selectComponent
- node.setAttribute("draggable", true)
+ // Allow dragging if required
+ const parent = node.closest("[data-type='component']")
+ if (parent && parent.dataset.draggable === "true") {
+ node.setAttribute("draggable", true)
+ }
// Creates event listeners and applies initial styles
const setupStyles = (newStyles = {}) => {