Socket
Socket
Sign inDemoInstall

react-dropzone

Package Overview
Dependencies
Maintainers
2
Versions
176
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dropzone - npm Package Compare versions

Comparing version 10.1.5 to 10.1.6

18

dist/es/index.js

@@ -491,7 +491,3 @@ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }

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();
var onClickCb = useCallback(function () {
if (noClick) {

@@ -704,3 +700,5 @@ return;

onDrop: composeDragHandler(composeEventHandlers(onDrop, onDropCb))
}, refKey, rootRef), !disabled && !noKeyboard ? {
}, refKey, rootRef), rootRef.current && rootRef.current.tagName === 'LABEL' ? {
htmlFor: 'noop'
} : {}, !disabled && !noKeyboard ? {
tabIndex: 0

@@ -720,3 +718,4 @@ } : {}, rest);

onClick = _ref4.onClick,
rest = _objectWithoutProperties(_ref4, ["refKey", "onChange", "onClick"]);
disabled = _ref4.disabled,
rest = _objectWithoutProperties(_ref4, ["refKey", "onChange", "onClick", "disabled"]);

@@ -733,3 +732,4 @@ var inputProps = _defineProperty({

autoComplete: 'off',
tabIndex: -1
tabIndex: -1,
disabled: disabled || noClick
}, refKey, inputRef);

@@ -739,3 +739,3 @@

};
}, [inputRef, accept, multiple, onDropCb, disabled]);
}, [inputRef, accept, multiple, onDropCb, disabled, noClick]);
var fileCount = draggedFiles.length;

@@ -742,0 +742,0 @@ var isMultipleAllowed = multiple || fileCount <= 1;

@@ -168,3 +168,3 @@ {

},
"version": "10.1.5",
"version": "10.1.6",
"engines": {

@@ -171,0 +171,0 @@ "node": ">= 8"

@@ -457,24 +457,17 @@ /* eslint prefer-template: 0 */

// Cb to open the file dialog when click occurs on the dropzone
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()
const onClickCb = useCallback(() => {
if (noClick) {
return
}
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])
// 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([])

@@ -692,2 +685,3 @@ const onDocumentDrop = event => {

[refKey]: rootRef,
...(rootRef.current && rootRef.current.tagName === 'LABEL' ? { htmlFor: 'noop' } : {}),
...(!disabled && !noKeyboard ? { tabIndex: 0 } : {}),

@@ -717,3 +711,3 @@ ...rest

const getInputProps = useMemo(
() => ({ refKey = 'ref', onChange, onClick, ...rest } = {}) => {
() => ({ refKey = 'ref', onChange, onClick, disabled, ...rest } = {}) => {
const inputProps = {

@@ -728,2 +722,3 @@ accept,

tabIndex: -1,
disabled: disabled || noClick,
[refKey]: inputRef

@@ -737,3 +732,3 @@ }

},
[inputRef, accept, multiple, onDropCb, disabled]
[inputRef, accept, multiple, onDropCb, disabled, noClick]
)

@@ -740,0 +735,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc