Completely updated React, fixed #11, (hopefully)

This commit is contained in:
2018-03-04 19:11:49 -05:00
parent 6e0afd6e2a
commit 34e5f5139a
13674 changed files with 333464 additions and 473223 deletions

View File

@@ -286,19 +286,25 @@ var Dropzone = function (_React$Component) {
}, {
key: 'onFileDialogCancel',
value: function onFileDialogCancel() {
var _this4 = this;
// timeout will not recognize context of this method
var onFileDialogCancel = this.props.onFileDialogCancel;
var fileInputEl = this.fileInputEl;
var isFileDialogActive = this.isFileDialogActive;
// execute the timeout only if the onFileDialogCancel is defined and FileDialog
// is opened in the browser
// execute the timeout only if the FileDialog is opened in the browser
if (onFileDialogCancel && isFileDialogActive) {
if (this.isFileDialogActive) {
setTimeout(function () {
// Returns an object as FileList
var FileList = fileInputEl.files;
if (!FileList.length) {
isFileDialogActive = false;
if (_this4.fileInputEl != null) {
// Returns an object as FileList
var files = _this4.fileInputEl.files;
if (!files.length) {
_this4.isFileDialogActive = false;
}
}
if (typeof onFileDialogCancel === 'function') {
onFileDialogCancel();
}
}, 300);
@@ -472,8 +478,8 @@ Dropzone.propTypes = {
disableClick: PropTypes.bool,
/**
* Enable/disable the dropzone entirely
*/
* Enable/disable the dropzone entirely
*/
disabled: PropTypes.bool,
/**
@@ -502,12 +508,12 @@ Dropzone.propTypes = {
name: PropTypes.string,
/**
* Maximum file size
* Maximum file size (in bytes)
*/
maxSize: PropTypes.number,
/**
* Minimum file size
* Minimum file size (in bytes)
*/
minSize: PropTypes.number,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long