react-dnd / react-dnd-html5-backend

HTML5 backend for React DnD [Legacy Repo]

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Retrieve monitor.getItem().files in canDrop function?

cheemeng opened this issue · comments

Hi,

I'd like to ensure that:

  1. Only 1 file is dragged over, and
  2. The file type matches my list of allowed files.

However when I try to retrieve the value of files in the canDrop function, it returns a Browser doesn't allow reading "files" until the drop event.

Are there ways to work around this? Thanks!

commented

Unfortunately not, precisely because

Browser doesn't allow reading "files" until the drop event.

😉