flutter_dropzone
flutter_dropzone copied to clipboard
Mime type filter not working!
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()
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?
The browser I'm using is Chrome, this problem occurs only if the file mime type is not handled by your widget.
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:
Couple of left
events for both zones, zone 1 didn't accept the JPG, zone 2 finally did.
@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.
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.