If you'd like to prevent drag events propagation from the child to parent, you can use the `{noDragEventsBubbling}` property on the child:
```jsx harmony
import React from 'react';
import {useDropzone} from 'react-dropzone';
function OuterDropzone(props) {
const {getRootProps} = useDropzone({
// Note how this callback is never invoked if drop occurs on the inner dropzone
onDrop: files => console.log(files)
});
return (
);
}
```
Note that internally we use `event.stopPropagation()` to achieve the behavior illustrated above, but this comes with its own [drawbacks](https://javascript.info/bubbling-and-capturing#stopping-bubbling).
If you'd like to selectively turn off the default dropzone behavior for `onClick`, use the `{noClick}` property:
```jsx harmony
import React from 'react';
import {useDropzone} from 'react-dropzone';
function DropzoneWithoutClick(props) {
const {getRootProps, getInputProps, acceptedFiles} = useDropzone({noClick: true});
const files = acceptedFiles.map(file =>
{file.path}
);
return (
Dropzone without click events
);
}
```
If you'd like to selectively turn off the default dropzone behavior for `onKeyDown`, `onFocus` and `onBlur`, use the `{noKeyboard}` property:
```jsx harmony
import React from 'react';
import {useDropzone} from 'react-dropzone';
function DropzoneWithoutKeyboard(props) {
const {getRootProps, getInputProps, acceptedFiles} = useDropzone({noKeyboard: true});
const files = acceptedFiles.map(file =>
{file.path}
);
return (
Dropzone without keyboard events
(SPACE/ENTER and focus events are disabled)
);
}
```
Or you can prevent the default behavior for both click and keyboard events if you omit the input:
```jsx harmony
import React from 'react';
import {useDropzone} from 'react-dropzone';
function DropzoneWithoutClick(props) {
const {getRootProps, acceptedFiles} = useDropzone();
const files = acceptedFiles.map(file =>
{file.path}
);
return (
Dropzone without click events
);
}
```
**NOTE** If the browser supports the [File System Access API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API), removing the `` has no effect.
If you'd like to selectively turn off the default dropzone behavior for drag events, use the `{noDrag}` property:
```jsx harmony
import React from 'react';
import {useDropzone} from 'react-dropzone';
function DropzoneWithoutDrag(props) {
const {getRootProps, getInputProps, acceptedFiles} = useDropzone({noDrag: true});
const files = acceptedFiles.map(file =>
{file.path}
);
return (
Dropzone with no drag events
(Drag 'n' drop is disabled)
);
}
```
Keep in mind that if you provide your own callback handlers as well and use `event.stopPropagation()`, it will prevent the default dropzone behavior:
```jsx harmony
import React from 'react';
import Dropzone from 'react-dropzone';
// Note that there will be nothing logged when files are dropped
console.log(files)}>
{({getRootProps, getInputProps}) => (
event.stopPropagation()
})}
>
Drag 'n' drop some files here, or click to select files