Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DragDrop Restrictions on drag #607

Closed
kerry-convery opened this issue Feb 10, 2018 · 6 comments
Closed

DragDrop Restrictions on drag #607

kerry-convery opened this issue Feb 10, 2018 · 6 comments

Comments

@kerry-convery
Copy link

In the DragDrop plugin demo on the uppy website the restrictions only seem to work on drop. Is it possible to make them work on drag. What I would like to do is change the drop area border color if a file being dragged isn't allowed to be dropped rather than showing a message after the user has dropped. Can this be done in uppy and if so how?

Note that I have created a custom dragdrop plugin for greater control.

@stramel
Copy link

stramel commented Feb 10, 2018

Some of the restrictions can be enforced on drag.

@kerry-convery
Copy link
Author

I want to restrict by file type and size. Can either or both of these be enforced during drag? if so how? because setting file type restriction (e.g. Uppy(restrictions: {allowedFileTypes: 'image/*'}); only seems to work on drop.

@arturi
Copy link
Contributor

arturi commented Feb 11, 2018

Hi! Yes, currently we check restrictions when addFile and upload() are called, which happens after drop. To check for restrictions on drag, we’d need to process each file and detect its file type immediately then, and call this logic in Dashboard/DragDrop plugins, as opposed to doing it from Core.

@kerry-convery
Copy link
Author

So this is something that needs to be implemented and currently isn't supported out of the box?

@arturi
Copy link
Contributor

arturi commented Feb 11, 2018

Correct.

@arturi
Copy link
Contributor

arturi commented Feb 18, 2018

I’m going to add this to backlog and close for now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants