1
0
Fork 0
mirror of synced 2024-10-03 02:27:06 +13:00

fix: dnd - dragslot remains if we drop outside of target

This commit is contained in:
Michael Shanks 2020-08-13 14:08:20 +01:00
parent b21f8d6d02
commit 128b325614

View file

@ -102,6 +102,15 @@
return s
})
}
const dragend = () => {
dragDropStore.update(s => {
s.dropPosition = ""
s.targetComponent = null
s.componentToDrop = null
return s
})
}
</script>
<ul>
@ -122,6 +131,7 @@
class:selected={currentComponent === component}
style="padding-left: {level * 20 + 40}px"
draggable={true}
on:dragend={dragend}
on:dragstart={dragstart(component)}
on:dragover={dragover(component, index)}
on:drop={drop}