reppners / ngx-drag-drop

Angular directives using the native HTML Drag And Drop API
https://reppners.github.io/ngx-drag-drop/
BSD 3-Clause "New" or "Revised" License
311 stars 121 forks source link

setDragImage() Issue with Edge #29

Closed JaronrH closed 2 years ago

JaronrH commented 6 years ago

Edge throws an error when using Drag-Drop with a handle due to setDragImage() not being a valid function. Fix (for now) was to comment out the following in ngx-drag-drop.es5.js/ngx-drag-drop.js so that it isn't called:

    // set custom dragimage if present
    // set dragimage if drag is started from dndHandle
    if (typeof this.dndDragImageElementRef !== "undefined"
        || typeof event._dndUsingHandle !== "undefined") {
        setDragImage(event, this.dragImage, this.dndDragImageOffsetFunction);
    }
reppners commented 6 years ago

Thanks for reporting! Do you know of any workarounds or polyfills for setDragImage() to make it work on Edge / IE?

JaronrH commented 6 years ago

Sorry but I have not found a work around or pollyfill to make it work yet. For now, I just commented the above out in the npn source to avoid the issue entirely!

nischi commented 6 years ago

Maybe that works? https://github.com/MihaiValentin/setDragImage-IE

That works for me in my Angular-App

nischi commented 6 years ago

Okay do not really work with strict mode :(

nischi commented 6 years ago

so "fixed" my problem. I do not care about IE11 setDragImage function so i have done a polyfill like this:

if ('function' !== typeof DataTransfer.prototype.setDragImage) { DataTransfer.prototype.setDragImage = function(image, offsetX, offsetY) { }; }

reppners commented 2 years ago

Closing this one as by now Edge uses Chromium.