My template:
<div class="upload-component" @dragend="log('end')" @dragenter="dragEntered" @drop.prevent @dragover.prevent>
<div class="zone" @drop="dropped">
</div>
<p draggable="true">drag me</p>
</div>
My js:
export default {
name: 'UploadComponent',
methods: {
log(str){
console.log(str)
},
dragEntered(e){
// change some styles
},
dropped(e){
console.log(e.dataTransfer.files)
}
}
}
The problem:
If I drag the P element and drop it or hit escape it will log "end". If I come with a file from my desktop and put it back on desktop or hit escape or drop it, the dragend event wont fire and it wont log anything