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

Mime type filter not working! #48

Open
davsl opened this issue Dec 27, 2021 · 5 comments
Open

Mime type filter not working! #48

davsl opened this issue Dec 27, 2021 · 5 comments

Comments

@davsl
Copy link

davsl commented Dec 27, 2021

If I set a mime type filter to the DropzoneView and then I try to drop an excluded file type, onLeave won't be called. This is a problem because I want to give the DropzoneView a different shade of color when hovering and the color never returns back to normal when the file is released.
The other big problem with mime type filter is that it does not work when picking files using _dropController.pickFiles()

@deakjahn
Copy link
Owner

As far as I can tell, the plugin does nothing with onLeave, just passes it on. Could it be that the browser doesn't send this event at all?

deakjahn added a commit that referenced this issue Dec 27, 2021
deakjahn added a commit that referenced this issue Dec 27, 2021
@deakjahn deakjahn reopened this Dec 27, 2021
@davsl
Copy link
Author

davsl commented Dec 30, 2021

The browser I'm using is Chrome, this problem occurs only if the file mime type is not handled by your widget.

@deakjahn
Copy link
Owner

deakjahn commented Dec 30, 2021

I can't reproduce this yet. I added

mime: const ['image/png'],

to the first drop zone in the example and tried to drop a JPG on it. This is what I got:

Untitled-1

Couple of left events for both zones, zone 1 didn't accept the JPG, zone 2 finally did.

@deakjahn
Copy link
Owner

@davsl Any new developments? GitHub brought this up as a new notification but I don't know why. :-) As I showed, it seems to work for me.

@fralways
Copy link

file filter works for me for both drag&drop and file picker.
hint: supported mime files are set directly in pickFiles() function like: _controller!.pickFiles(mime: supportedDocumentsMimeTypes)

additionally, on leave also works for me even when im dragging not supported file type.

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

No branches or pull requests

3 participants