react-dnd / react-dnd-html5-backend

HTML5 backend for React DnD [Legacy Repo]
MIT License
146 stars 97 forks source link

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

Closed cheemeng closed 8 years ago

cheemeng commented 8 years ago

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!

gaearon commented 8 years ago

Unfortunately not, precisely because

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

:wink: