Skip to content

Commit

Permalink
feat(upload): drop event (#2591)
Browse files Browse the repository at this point in the history
  • Loading branch information
chaishi authored Nov 6, 2023
1 parent 55bddb0 commit 01d33bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/upload/hooks/useDrag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ export default function useDrag(props: UploadDragEvents) {

const { files } = event.dataTransfer;
const dragFiles: File[] = getFileList(files, accept);
if (!dragFiles.length) return;

props.onDragFileChange?.(dragFiles);
if (dragFiles.length) {
props.onDragFileChange?.(dragFiles);
}
props.onDrop?.({ e: event });
};

Expand Down

0 comments on commit 01d33bf

Please sign in to comment.