Open richelivargas opened 7 years ago
If a file is loaded two times, in second time the event is not call. It occurs when the file is loaded by click event (hiddenFileInput). In second time the change event is not call because is the same file.
In dropzone.js
Original
return _this.hiddenFileInput.addEventListener("change", function() { var file, files, _i, _len; files = _this.hiddenFileInput.files; if (files.length) { for (_i = 0, _len = files.length; _i < _len; _i++) { file = files[_i]; _this.addFile(file); } } _this.emit("addedfiles", files); return setupHiddenFileInput(); });
My solution
return _this.hiddenFileInput.addEventListener("click", function() { _this.hiddenFileInput.value = ''; return _this.hiddenFileInput.addEventListener("change", function() { var file, files, _i, _len; files = _this.hiddenFileInput.files; if (files.length) { for (_i = 0, _len = files.length; _i < _len; _i++) { file = files[_i]; _this.addFile(file); } } _this.emit("addedfiles", files); return setupHiddenFileInput(); }); });
Thanks for catching this up, might be better to report issue directly to https://github.com/enyo/dropzone/issues - Our core library for FileUploader
If a file is loaded two times, in second time the event is not call. It occurs when the file is loaded by click event (hiddenFileInput). In second time the change event is not call because is the same file.
In dropzone.js
Original
My solution