diff --git a/packages/client/src/components/preview/DNDHandler.svelte b/packages/client/src/components/preview/DNDHandler.svelte index df36d7cb85..8dd9a666bf 100644 --- a/packages/client/src/components/preview/DNDHandler.svelte +++ b/packages/client/src/components/preview/DNDHandler.svelte @@ -183,7 +183,9 @@ // Find the next valid component to consider dropping over, ignoring nested // block components - const component = e.target?.closest?.(".component:not(.block)") + const component = e.target?.closest?.( + `.component:not(.block):not(.${sourceId})` + ) if (component && component.classList.contains("droppable")) { targetInfo = { id: component.dataset.id, diff --git a/packages/client/src/stores/screens.js b/packages/client/src/stores/screens.js index 69dcf99b07..7419e24a53 100644 --- a/packages/client/src/stores/screens.js +++ b/packages/client/src/stores/screens.js @@ -46,8 +46,7 @@ const createScreenStore = () => { // Insert DND placeholder if required const { dndParent, dndIndex, selectedComponentId } = $builderStore - const insert = true - if (insert && activeScreen && dndParent && dndIndex != null) { + if (activeScreen && dndParent && dndIndex != null) { // Remove selected component from tree let selectedParent = findComponentParent( activeScreen.props,