Socket
Socket
Sign inDemoInstall

react-dropzone

Package Overview
Dependencies
Maintainers
3
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 14.0.1 to 14.1.0

25

dist/es/index.js

@@ -89,3 +89,4 @@ var _excluded = ["children"],

validator: null,
useFsAccessApi: true
useFsAccessApi: true,
autoFocus: false
};

@@ -196,2 +197,7 @@ Dropzone.defaultProps = defaultProps;

/**
* Set to true to focus the root element on render
*/
autoFocus: PropTypes.bool,
/**
* Cb for when the `dragenter` event occurs.

@@ -401,2 +407,3 @@ *

* to open the file picker instead of using an `<input type="file">` click event.
* @param {boolean} autoFocus Set to true to auto focus the root element.
* @param {Function} [props.onFileDialogOpen] Cb for when opening the file dialog

@@ -457,2 +464,3 @@ * @param {dragCb} [props.onDragEnter] Cb for when the `dragenter` event occurs.

useFsAccessApi = _defaultProps$props.useFsAccessApi,
autoFocus = _defaultProps$props.autoFocus,
preventDropOnDocument = _defaultProps$props.preventDropOnDocument,

@@ -478,2 +486,7 @@ noClick = _defaultProps$props.noClick,

}, [onFileDialogCancel]);
/**
* @constant
* @type {React.MutableRefObject<HTMLElement>}
*/
var rootRef = useRef(null);

@@ -539,3 +552,11 @@ var inputRef = useRef(null);

};
}, [rootRef, preventDropOnDocument]);
}, [rootRef, preventDropOnDocument]); // Auto focus the root when autoFocus is true
useEffect(function () {
if (!disabled && autoFocus && rootRef.current) {
rootRef.current.focus();
}
return function () {};
}, [rootRef, autoFocus, disabled]);
var onErrCb = useCallback(function (e) {

@@ -542,0 +563,0 @@ if (onError) {

2

package.json

@@ -174,3 +174,3 @@ {

"typings": "typings/react-dropzone.d.ts",
"version": "14.0.1",
"version": "14.1.0",
"engines": {

@@ -177,0 +177,0 @@ "node": ">= 10.13"

@@ -71,2 +71,3 @@ /* eslint prefer-template: 0 */

useFsAccessApi: true,
autoFocus: false,
};

@@ -178,2 +179,7 @@

/**
* Set to true to focus the root element on render
*/
autoFocus: PropTypes.bool,
/**
* Cb for when the `dragenter` event occurs.

@@ -386,2 +392,3 @@ *

* to open the file picker instead of using an `<input type="file">` click event.
* @param {boolean} autoFocus Set to true to auto focus the root element.
* @param {Function} [props.onFileDialogOpen] Cb for when opening the file dialog

@@ -439,2 +446,3 @@ * @param {dragCb} [props.onDragEnter] Cb for when the `dragenter` event occurs.

useFsAccessApi,
autoFocus,
preventDropOnDocument,

@@ -465,3 +473,8 @@ noClick,

/**
* @constant
* @type {React.MutableRefObject<HTMLElement>}
*/
const rootRef = useRef(null);
const inputRef = useRef(null);

@@ -526,2 +539,10 @@

// Auto focus the root when autoFocus is true
useEffect(() => {
if (!disabled && autoFocus && rootRef.current) {
rootRef.current.focus();
}
return () => {};
}, [rootRef, autoFocus, disabled]);
const onErrCb = useCallback(

@@ -528,0 +549,0 @@ (e) => {

@@ -55,2 +55,3 @@ import * as React from "react";

useFsAccessApi?: boolean;
autoFocus?: boolean;
};

@@ -57,0 +58,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