Add file drag and drop support on wasm #1808
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
cargo fmt
has been run on this branchcargo doc
builds successfullyCHANGELOG.md
if knowledge of this change could be valuable to usersHello!
I'm trying to add drag and drop for wasm.
I don't know if I should open an issue for this as well, let me know if I should.
I've arrived to a sort of PoC for it on this branch but I have several issues.
If you want to try out this branch, just run the "web" example and watch for any of the
DroppedFile
,HoveredFile
,HoveredFileCanceled
in theWindowEvent
.First of all I seem to have a bug for
HoveredFiles
because when getting the files in the underlying objects, the file list is always 0. I need to investigate that some more.Currently the
DroppedFile
,HoveredFile
only return the filenames (not the full path), mainly because of HTML5 security reasons. And I don't really know how to move from here.I see two ways to solve this :
DroppedFile
,HoveredFile
for wasm, which return some new type which will be the file data directly (or allows for easy access, without having to deal with HTML stuff).DroppedFile
,HoveredFile
to gain access to the correct file. This sounds more reaosnable, but I have currrently no idea how to do this.I'll look into this some more, but if anyone has any ideas or feedbacks I would appreciate it!
Related issue : #720