From 01d33bf4c1ecf35b9c492a335b3fd53c872f0371 Mon Sep 17 00:00:00 2001 From: sheepluo Date: Mon, 6 Nov 2023 10:42:22 +0800 Subject: [PATCH] feat(upload): drop event (#2591) --- src/upload/hooks/useDrag.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/upload/hooks/useDrag.ts b/src/upload/hooks/useDrag.ts index 96478d1681..99ddcb76bc 100644 --- a/src/upload/hooks/useDrag.ts +++ b/src/upload/hooks/useDrag.ts @@ -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 }); };