1
0
Fork 0
mirror of synced 2024-07-08 15:56:23 +12: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 764a09118c
commit 04cee2c3e3

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}