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
|
// Find the next valid component to consider dropping over, ignoring nested
|
||||||
// block components
|
// 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")) {
|
if (component && component.classList.contains("droppable")) {
|
||||||
targetInfo = {
|
targetInfo = {
|
||||||
id: component.dataset.id,
|
id: component.dataset.id,
|
||||||
|
|
|
@ -46,8 +46,7 @@ const createScreenStore = () => {
|
||||||
|
|
||||||
// Insert DND placeholder if required
|
// Insert DND placeholder if required
|
||||||
const { dndParent, dndIndex, selectedComponentId } = $builderStore
|
const { dndParent, dndIndex, selectedComponentId } = $builderStore
|
||||||
const insert = true
|
if (activeScreen && dndParent && dndIndex != null) {
|
||||||
if (insert && activeScreen && dndParent && dndIndex != null) {
|
|
||||||
// Remove selected component from tree
|
// Remove selected component from tree
|
||||||
let selectedParent = findComponentParent(
|
let selectedParent = findComponentParent(
|
||||||
activeScreen.props,
|
activeScreen.props,
|
||||||
|
|
Loading…
Reference in New Issue