-
Notifications
You must be signed in to change notification settings - Fork 36
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
onError or onLeave not called when incorrect mime type dropped #66
Comments
I'm not really sure this would be a good idea, it was never intended that way. MIME types simply restrict the droppable files but don't necessarily mean a hard error. It would certainly be a breaking change if we modified that behavior now... |
Hi, thanks for the quick response! Your arguments are valid, but we have some situations: 1- the onHover is called for files not accepted and I highlight the zone, if the user tries to add I have no event afterwards to remove the highlight and give a feedback warning that files are not accepted, maybe create a new event called onDropInvalid ? I even managed to solve the hover issue by adding a MouseRegion over the zone and controlling it by onEnter / onExite, but I still haven't seen a way to display feedback to the user warning that the file is not accepted. |
@gbmiranda Adding a new callback wasn't that complicated. Please, check it out. |
Perfect thank you! Will you publish to pub.dev? |
If you say it's safe to do so... |
onDropInvalid event was not called :( |
I tried the example, even left the MIME there for now and it works for me. Did you try that directly? |
Then first, please, try the example, that's the one we have in common... |
if I download the example and run it, it works, but when I put it in my project with version 3.0.6 it doesn't. Even if I exactly copy your DropZone implementation the onDropInvalid event is not called. Could it be that something was missing from the uploaded version? |
Strange. All three seem to be upgraded:
Do check in your I'll try to reproduce it in a standalone test in the meantime. |
@gbmiranda I really can't get a handle on this yet. I started a new project, web only. I copied And it runs just fine: |
What you could do is to put a breakpoint here in your browser Dev Tools and see what really happens, step by step: flutter_dropzone/flutter_dropzone_web/lib/assets/flutter_dropzone.js Lines 52 to 59 in be7275b
|
I didn't yet change it to .10 in the |
takes 3.0.9 and 3.0.10, but for some reason when I build it uses 3.0.9... it only works if I override it. |
Who knows. I advanced the version now here and it will appear in the next published one. |
Hi,
onLeave or onError is not being called after dropping a file not allowed by the mime type.
Any chance of correction?
The text was updated successfully, but these errors were encountered: