1

I am listening for drop events on a div element. The events fire in Chrome (v36.0.1985), Firefox (v30) but do not fire in IE (v10.0.9200). I've created a simple JSFiddle to illustrate the problem.

Works:

1.) Open YouTube in Chrome

2.) Open http://jsfiddle.net/AXw6f/17/ in Chrome

3.) Drag a youtube video thumbnail onto the "DropZone" and an alert will appear.

Fails:

Redo the above but use IE 10 or 11. Instead of an alert in step 3 it simply redirects the page.

NOTE: I've found an example where IE would recognize a drop at http://jsfiddle.net/Ctnpe/ but it drops onto a canvas. When I replace the canvas with a div it reverts back to the redirect.

I've tried various combinations of preventDefault, stopPropogation, and return false with no success:

$("#DropZone").on("dragleave", function (event) {
    event.preventDefault();
    event.stopPropagation();
    return false;
});

$("#DropZone").on("dragenter", function (event) {
    event.preventDefault();
    event.stopPropagation();
    return false;
});

$("#DropZone").on("dragover", function (event) {
    event.preventDefault();
    event.stopPropagation();
    return false;
});

$('#DropZone').on('drop', function () {
    alert('test');
    event.preventDefault();
    event.stopPropagation();
    return false;
});

Any help is greatly appreciated. Thanks!

ngagejason
  • 11
  • 1
  • I tried this in my application and I get the same result. Very annoying how IE is always delinquent. Interesting that it works with canvas. The only thing that I could find is: http://answers.microsoft.com/en-us/ie/forum/ie9-windows_7/can-one-prevent-ie9-from-opening-a-newly-dropped/b92074ea-a977-4e9f-a6f1-f0b1d7671647?page=2. Holding shift is supposed to revert to normal behaviour. But shift didn't work for me. Once you get passed this you will have other inconsistencies: http://stackoverflow.com/a/19564982/746754. Good luck and post and answer when you find it. I would be interested to know. – acarlon Jul 26 '14 at 23:49
  • You might also find this useful: http://stackoverflow.com/questions/5500615/internet-explorer-9-drag-and-drop-dnd. Though it seems to be more to do with drag than drop. – acarlon Jul 27 '14 at 00:01
  • Holding shift didn't work for me either. If I get an answer I'll def post. Thanks. – ngagejason Jul 27 '14 at 01:08
  • I tried inlining the function and it gets more odd. With this JSFiddle (http://jsfiddle.net/AXw6f/21/) you can drag from Chrome to IE but not from IE to IE. I wonder if IE uses a shared resource behind the scenes and it's preventing an IE to IE Drag/Drop. – ngagejason Jul 27 '14 at 02:18

0 Answers0