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

Question: additive Drag+Drop possible? #91

Closed
DNF-SaS opened this issue Sep 28, 2019 · 2 comments · Fixed by #92
Closed

Question: additive Drag+Drop possible? #91

DNF-SaS opened this issue Sep 28, 2019 · 2 comments · Fixed by #92
Assignees
Labels
enhancement New feature or request

Comments

@DNF-SaS
Copy link

DNF-SaS commented Sep 28, 2019

Hi,

I'd like to fake the popular "dropzone.js" with BlazorFileReader.
Main motivation is, that dropzone.js can collect multiple drag+drops and start the upload afterwards.
Unfortunately, BlazorFileReader's DragDrop-Demo clears the droplist before every dropevent-handling. I'm a simple man, so I removed FileList.Clear() in RefreshFileList()) ;-) - was fine on the first look.
But on the second, I realized that the FileInfo-Contents changed but IFileReference.ReadFileInfoAsync() returned the same stream twice. :-(
What has to be done to mimic "dropzone.js"'s behavior?

Thanks for help!
Sascha

@Tewr
Copy link
Owner

Tewr commented Sep 30, 2019

this.elementDataTransfers.set(ev.target, ev.dataTransfer.files);

the file list is being reset upon drop here

I'd have to test but I'm guessing a simple option passed to the register method could make it additive. Currently, it's not really possible, unless you create a new drop target in place of the old one on each drop event.

@Tewr Tewr added the enhancement New feature or request label Sep 30, 2019
@Tewr Tewr self-assigned this Sep 30, 2019
@Tewr
Copy link
Owner

Tewr commented Sep 30, 2019

OK so I had five minutes to look at the demo of dropzone.js, and I agree that BlazorFileReader should be more flexible on this particular point. I'll add the option and a demo when I get the time. Should be relatively simple, however I'll have to workaround the fact that multiple drop events is being raised if I remember correctly, which is currently avoided as we do a complete reset each time.

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

Successfully merging a pull request may close this issue.

2 participants