Remove dragged component from consideration of drop target
This commit is contained in:
parent
73a206e2f1
commit
e90a79257f
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue