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
Safari - TypeError: files.map is not a function. #1640
Comments
I observe the same issue on our site |
same here. on mobile safari everything works fine. |
Same here. Anyone looking in to this? |
Same here, on Safari 10.1 |
I have the same issue v11 |
I found solution for this error. Find (line 1654) and replace this: to this: const files_array = Array.from(files); Now works with safari and chrome, also Firefox I've added changes to source - please test on different browsers like IE and older SAFARI. |
@djmassive absolutely great! |
@djmassive - Awesome!
|
@Sorenfu this works also on safari - so if this works on other browsers that will be all :-) |
Had issues in capybara. Did this now
|
@Sorenfu That works great for me on safari, chrome, and mobile safari; thanks! |
I am getting the same error and I am using the latest release of the library. However, the dropzone in http://www.dropzonejs.com works fine in Safari. |
@nop33 The website seems to use an older version of dropzone, tested it with version 5.1.1 where this error does not exist. |
5.2.0 downloaded today had the problem, got fixed with the solution from @Sorenfu. |
@Sorenfu solution also working for IE11 |
Is any contributor/developer on the project actually working on this, either on here or on GitLab? Seems like a pretty serious issue that needs resolving immediately. |
@lukeify, as @Sorenfu suggested, add the following temporary fix in your code. Assuming an initialisation of the Dropzone as below: var myDropzone = new Dropzone("#my-dropzone", {
...
}); add the following right below: myDropzone.handleFiles = function(files) {
var _this5 = this;
var files_array = [];
for (var i = 0; i < files.length; i++) {
files_array.push(files[i]);
}
return files_array.map(function(file) {
return _this5.addFile(file);
});
}; |
@nop33. Yup. Aware of the fix. Just extremely surprised such a simple problem which breaks drag & drop in both IE & Safari has taken over a month to even be actioned. A PR has been submitted on GitLab (merge request 30) I see, but this should've been fixed as a 5.2.x point release weeks ago. |
Still not merged ? I see the issue closed but still have the bug by installing the latest version on npm .. (5.2.0) |
Update for those following this issue: the two-line fix has been merged, after 3+ months, into the master branch on the GitLab repository. To be published as 5.3.0 at some undisclosed time in the future. |
I guess all we need is a pollyfill for Safari userAgent. Editing the js library is not a good solution i feel. feel free to correct me.
|
Service-Comment: If you reach this issue and are wondering about the status of this fix, it has been merged (https://gitlab.com/meno/dropzone/merge_requests/31) and released with 5.3.0 (Jan, 23th 2018). See https://gitlab.com/meno/dropzone/blob/v5.3.0/CHANGELOG.md Also note that github is no longer the repository of this project, so issues, MR and other stuff that you might find in github regarding dropzone are potentially no longer relevant. |
In Safari 11 (maybe also earlier) dropping files into dropzone do not work for us.
In all other browsers tested (Chrome, Firefox) it works just fine. In Safari only the click/filebrowser functionality works.
JS Error in the Console:
Any idea?
The text was updated successfully, but these errors were encountered: