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
299 stars 118 forks source link

External Drag & Drop doesn't work on Firefox #35

Closed JorisBrunel closed 5 years ago

JorisBrunel commented 5 years ago

Hi,

As the title says, drag & drop from an external source doesn't work on Firefox.

You can reproduce by going to the "Native" tab : https://reppners.github.io/ngx-drag-drop/

Thanks.

reppners commented 5 years ago

Hi, thanks for reporting :)

I can confirm its not working. Will look into it the next couple of days.

jguyenot commented 5 years ago

Hello,

i confirm too that in firefox the external source open the file directly onto the page.

In Chrome and Internet Explorer the event.dataTransfert is not populated with the file. image

jguyenot commented 5 years ago

Hi, after some study, the problem is with the console. If i log dataTransfer.files[0] is full.

bkarv commented 5 years ago

Just saw this I have the same issue with Chrome see below Issue 48

@jguyenot Did you find a solution?

reppners commented 5 years ago

Did some research and it might be related to my mistake of not implementing firefox requirements for drag and drop correctly in my demo.

Firefox needs a dragstart handler which sets some data on the dataTransfer instance of the event. See https://salesforce.stackexchange.com/a/214639

EDIT: aah well.. no it should work in my demo since its only items that are draggable by default.. research goes on.

reppners commented 5 years ago

Resolved it and released fix with rc.4. You can install with npm install ngx-drag-drop@next. It's still on a branch pending confirmation before I'll merge in master.

Failure reason was that Firefox seems to emit dragover with dataTransfer being null which the logic wasn't capable of handling. Now it is and falls back to default values.

JorisBrunel commented 5 years ago

Hi, I can confirm that it is now working on Firefox !

Thanks !