Closed lasys closed 2 years ago
The idea is sane but it won't work this way. Being a federated plugin with a platform interface, breaking changes are very much discouraged. So, first we would need to change the interface, then adapt the rest. And even that only in a way that doesn't break current functionality.
So, I would suggest to leave onDrop
as it is, to add a new onDropMultiple
beside it (with all the underlying necessities like DropzoneDropMultipleEvent
and more). Then everybody can decide which event to subscribe to and nobody has to change existing code.
OK, I changed the interface a little bit (version 2.0.5), let's follow from here.
@lasys because this change goes against yours, you probably want to pull the new stuff first and experiment with that. It seems to work for me all right but let's test if before publishing. :-)
Thank you for the quick response, support and implementation! Great work! You are right. It is much better to let the developer decide whether to process one file or multiple files.
I skimmed the code and it looks good to me, but to be on the safe side, I will integrate and test your new code on Monday and give you feedback then.
@deakjahn I just checked your new code and it works fine!
One small suggestion: When someone adds onDrop
and onDropMultiple
, both handlers are executed.
Maybe it is more intuitive that if more than one file is dropped and onDropMultiple is set, then only this method is called and the other way around.
Well, I don't know. And if they want to have both? Who knows? :-)
Nobody knows :D
So from my side, it fits and it would be great, if you release a new version.
Thanks again!
I think I have it.
Currently when onDrop is called each file will be handled separately. My suggestion is that onDrop returns an array which contains all dropped files.