react-dropzone
Advanced tools
Comparing version 10.1.2 to 10.1.3
@@ -491,3 +491,7 @@ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
var onClickCb = useCallback(function () { | ||
var onClickCb = useCallback(function (event) { | ||
// Prevent click events from propagating to the <input> when the click event | ||
// originated from a <label> that wraps the dropzone | ||
event.preventDefault(); | ||
if (noClick) { | ||
@@ -494,0 +498,0 @@ return; |
@@ -168,3 +168,3 @@ { | ||
}, | ||
"version": "10.1.2", | ||
"version": "10.1.3", | ||
"engines": { | ||
@@ -171,0 +171,0 @@ "node": ">= 8" |
@@ -457,17 +457,24 @@ /* eslint prefer-template: 0 */ | ||
// Cb to open the file dialog when click occurs on the dropzone | ||
const onClickCb = useCallback(() => { | ||
if (noClick) { | ||
return | ||
} | ||
const onClickCb = useCallback( | ||
event => { | ||
// Prevent click events from propagating to the <input> when the click event | ||
// originated from a <label> that wraps the dropzone | ||
event.preventDefault() | ||
// In IE11/Edge the file-browser dialog is blocking, therefore, use setTimeout() | ||
// to ensure React can handle state changes | ||
// See: https://github.com/react-dropzone/react-dropzone/issues/450 | ||
if (isIeOrEdge()) { | ||
setTimeout(openFileDialog, 0) | ||
} else { | ||
openFileDialog() | ||
} | ||
}, [inputRef, noClick]) | ||
if (noClick) { | ||
return | ||
} | ||
// In IE11/Edge the file-browser dialog is blocking, therefore, use setTimeout() | ||
// to ensure React can handle state changes | ||
// See: https://github.com/react-dropzone/react-dropzone/issues/450 | ||
if (isIeOrEdge()) { | ||
setTimeout(openFileDialog, 0) | ||
} else { | ||
openFileDialog() | ||
} | ||
}, | ||
[inputRef, noClick] | ||
) | ||
const [dragTargets, setDragTargets] = useState([]) | ||
@@ -474,0 +481,0 @@ const onDocumentDrop = event => { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
334190
4954