Dragend event not firing in Chrome when an iframe is moved in drop function Dragend event not firing in Chrome when an iframe is moved in drop function google-chrome google-chrome

Dragend event not firing in Chrome when an iframe is moved in drop function


I agree that this is a Chrome bug and I don't have a solution for that. But in some cases you could work around the bug by delaying the iframe move until the drag events are done. It works in this fork of your fiddle. Just replace your

if(element.id === 'div1drag') {    document.getElementById('div1').appendChild(item);}else if(element.id === 'div2drag') {    document.getElementById('div2').appendChild(item);}

with this

if(element.id === 'div1drag') {    window.setTimeout(function() {        document.getElementById('div1').appendChild(item);    }, 0)}else if(element.id === 'div2drag') {    window.setTimeout(function() {        document.getElementById('div2').appendChild(item);    }, 0)}

Also, Thanks for reporting that bug. It was driving me crazy today.


A workaround which I used was to, instead of listening on the dragEnd event, I listened for the drop event, which served my needs adequately, though it might not work for everyone.