dom-examples icon indicating copy to clipboard operation
dom-examples copied to clipboard

File-drag.html example not working

Open Guilouf opened this issue 6 years ago • 2 comments

In fact it is not working every time. Sometimes the file are detected, and their name is printed, sometimes not. The drop event is always fired.

Here is an output, showing that it only worked once:

File(s) in drop zone
File-drag.html:32:7
File(s) dropped File-drag.html:39:7
Removing drag data File-drag.html:65:7
File(s) in drop zone
File-drag.html:32:7
File(s) dropped File-drag.html:39:7
Removing drag data File-drag.html:65:7
File(s) in drop zone
File-drag.html:32:7
File(s) dropped File-drag.html:39:7
Removing drag data File-drag.html:65:7
File(s) in drop zone
File-drag.html:32:7
File(s) dropped File-drag.html:39:7
... file[0].name = screen_fluoread.png File-drag.html:50:13
Removing drag data

Files from os to browser using firefox. Using chrome there is no issues

Guilouf avatar Apr 15 '19 13:04 Guilouf

I tested this example in Firefox on both Windows and Linux and found that the behavior is different.

In Linux (tested Firefox 60.6.1esr and 66.0.3, both 64-bit), I noticed that when you drag one or more files over, the dragover event takes some time to fire (scaling with the size of the files). If you drop before this event happens, the drop event does not occur.

In Windows (Firefox 66.0.3 64-bit), the dragover event happens instantly and the example works as expected. I wasn't able to test the case where I drop the files before the dragover event fires.

luisbc92 avatar May 02 '19 22:05 luisbc92