Skip to content

Commit

Permalink
fix: Check drag event contains files before showing "copy" cursor
Browse files Browse the repository at this point in the history
closes #1042
  • Loading branch information
tommoor authored and rolandjitsu committed Mar 26, 2021
1 parent 6f0e826 commit ec93425
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.js
Expand Up @@ -554,13 +554,14 @@ export function useDropzone(options = {}) {
event.persist()
stopPropagation(event)

if (event.dataTransfer) {
const hasFiles = isEvtWithFiles(event);
if (hasFiles && event.dataTransfer) {
try {
event.dataTransfer.dropEffect = 'copy'
} catch {} /* eslint-disable-line no-empty */
}

if (isEvtWithFiles(event) && onDragOver) {
if (hasFiles && onDragOver) {
onDragOver(event)
}

Expand Down

0 comments on commit ec93425

Please sign in to comment.