Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mantinedev/mantine
Browse files Browse the repository at this point in the history
  • Loading branch information
rtivital committed Nov 23, 2022
2 parents 5373ee3 + ed8c8cf commit db2f1d9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/mantine-dropzone/src/Dropzone.tsx
Expand Up @@ -32,7 +32,10 @@ export interface DropzoneProps
/** Disable files capturing */
disabled?: boolean;

/** Called when files are dropped into dropzone */
/** Called when any files are dropped into dropzone */
onDropAny?(files: FileWithPath[], fileRejections: FileRejection[]): void;

/** Called when valid files are dropped into dropzone */
onDrop(files: FileWithPath[]): void;

/** Called when selected files don't meet file restrictions */
Expand Down Expand Up @@ -122,6 +125,7 @@ export function _Dropzone(props: DropzoneProps) {
maxSize,
accept,
children,
onDropAny,
onDrop,
onReject,
openRef,
Expand Down Expand Up @@ -149,6 +153,7 @@ export function _Dropzone(props: DropzoneProps) {
);

const { getRootProps, getInputProps, isDragAccept, isDragReject, open } = useDropzone({
onDrop: onDropAny,
onDropAccepted: onDrop,
onDropRejected: onReject,
disabled: disabled || loading,
Expand Down

0 comments on commit db2f1d9

Please sign in to comment.