Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: HTML Drag and Drop API not returning event.dataTransfer.files array consistently on all Electron versions #41977

Open
3 tasks done
Ob1To opened this issue Apr 26, 2024 · 2 comments
Labels
29-x-y bug 🪲 component/drag-and-drop has-repro-gist Issue can be reproduced with code at https://gist.github.com/ platform/linux

Comments

@Ob1To
Copy link

Ob1To commented Apr 26, 2024

Preflight Checklist

Electron Version

29.1.5

What operating system are you using?

Ubuntu

Operating System Version

Ubuntu 23.10

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

Consistently return the dropped files - event.dataTransfer.files array so that I can get the file.path property from it.

Actual Behavior

My original project is on Electron 3.1.11 and I'm developing on older Ubuntu 16.04 where I'm testing my code and it's working 100 out of 100 times. On another newer Mint 21.2 it's also working. It is my QA who found that on some new distributions, only some of the times, the drops return the array list populated with information.
Most of the times event.dataTransfer.files array is returned empty. It's like some race condition... only on some Linux distributions.
I thought that it maybe is related to the old Electron version but I created a blank project with the newest Electron version and it is the same behavior
Please check the screenshot where I'm printing in the console the event.dataTransfer.files[0].path property:

random return

Here is also a video of the problem:

reproducing.drop.down.not.working.mp4

Testcase Gist URL

https://gist.github.com/Ob1To/8adae451dad15605443eda03061601fd

Additional Information

No response

@Ob1To Ob1To added the bug 🪲 label Apr 26, 2024
@electron-issue-triage electron-issue-triage bot added the has-repro-gist Issue can be reproduced with code at https://gist.github.com/ label Apr 26, 2024
@dsanders11
Copy link
Member

From your repro video it looks like the files that aren't working are executable files, while those that do are text files. Is that just a coincidence in the video, or is that consistent?

@Ob1To
Copy link
Author

Ob1To commented May 7, 2024

From your repro video it looks like the files that aren't working are executable files, while those that do are text files. Is that just a coincidence in the video, or is that consistent?

Unfortunately, it is a coincidence. I have never found any file type correlation. The same behavior is observed with folders also. Randomly receiving the event.dataTransfer.files array..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
29-x-y bug 🪲 component/drag-and-drop has-repro-gist Issue can be reproduced with code at https://gist.github.com/ platform/linux
Projects
None yet
Development

No branches or pull requests

2 participants