diff --git a/packages/client/src/components/Component.svelte b/packages/client/src/components/Component.svelte
index 0f60c7f707..005eb12f2d 100644
--- a/packages/client/src/components/Component.svelte
+++ b/packages/client/src/components/Component.svelte
@@ -407,6 +407,7 @@
}
const scrollIntoView = () => {
+ return
const node = document.getElementsByClassName(id)?.[0]?.children[0]
if (!node) {
return
@@ -458,6 +459,9 @@
class:block={isBlock}
class:explode={interactive && hasChildren && inDndPath}
class:placeholder={id === "placeholder"}
+ class:screen={isScreen}
+ class:dragging={$builderStore.selectedComponentId === id &&
+ $builderStore.isDragging}
data-id={id}
data-name={name}
data-icon={icon}
@@ -504,4 +508,7 @@
.editing :global(*:hover) {
cursor: auto;
}
+ .dragging {
+ pointer-events: none;
+ }
diff --git a/packages/client/src/components/preview/DNDHandler.svelte b/packages/client/src/components/preview/DNDHandler.svelte
index f7783990a5..fbfdf06310 100644
--- a/packages/client/src/components/preview/DNDHandler.svelte
+++ b/packages/client/src/components/preview/DNDHandler.svelte
@@ -1,12 +1,3 @@
-
-
diff --git a/packages/client/src/stores/screens.js b/packages/client/src/stores/screens.js
index d5525d15c7..85293cd0ce 100644
--- a/packages/client/src/stores/screens.js
+++ b/packages/client/src/stores/screens.js
@@ -65,6 +65,9 @@ const createScreenStore = () => {
if (!parent._children?.length) {
parent._children = [placeholder]
} else {
+ parent._children = parent._children.filter(
+ x => x._id !== selectedComponentId
+ )
parent._children.splice(dndIndex, 0, placeholder)
}
}