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

Empty type for some file types in Chrome #34

Closed
arturi opened this issue Sep 27, 2017 · 4 comments
Closed

Empty type for some file types in Chrome #34

arturi opened this issue Sep 27, 2017 · 4 comments

Comments

@arturi
Copy link

arturi commented Sep 27, 2017

Thank you for the module! Been using it a while, great help!

Ran into a bug:

  1. Set up drag-drop on a target element;
  2. In Chrome drop a .csv (sample csv file) file on the target
  3. Inspect file object returned from by drag-drop, type will be empty;
  4. Try the same with https://github.com/mikolalysenko/drag-and-drop-files, type will be there for .csv file.

Demo: https://codepen.io/anon/pen/QqppOe.

The reason, I think, is that drag-drop is using e.dataTransfer.items, when it’s available, and then .webkitGetAsEntry() and then .file(callback) method on that. Somewhere in this chain the type gets lost. It remains, however, when calling .getAsFile() instead of .webkitGetAsEntry(): https://codepen.io/anon/pen/LzWWMQ.

Found a Chrome bug report here: https://bugs.chromium.org/p/chromium/issues/detail?id=155455

@feross
Copy link
Owner

feross commented Apr 13, 2018

Go ahead and give drag-drop@2.14.0 a try. I think this issue was fixed by cc0c84f

CodePen demo: https://codepen.io/anon/pen/yKWJpe

@feross feross closed this as completed Apr 13, 2018
@arturi
Copy link
Author

arturi commented Apr 15, 2018

Thank you!

In my tests drag-drop@2.14.0 returns just the folder name as a file, instead of folder content though :( Can’t try 3.0.0, cause we have not settled on IE11 support yet.

@feross
Copy link
Owner

feross commented Apr 17, 2018

@arturi What browser? Not all browsers support dropping a folder.

@feross
Copy link
Owner

feross commented Apr 19, 2018

This was a regression, you're right. See: #39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants