The dragLeave event fires before drop for HTML5 drag and drop events

JavascriptWeb DevelopmentFront End Scripts

To solve this issue for drag and drop event, dragLeave fires before drop sometimes:

onDragOver = function(e) { e.stopPropagation() }
onDrop = function(e) {
   /* for drop */

Under drop, you can set this:

function drop(ev)
   var data=event.dataTransfer.getData("Text");;
Updated on 28-Jan-2020 10:02:35