https://github.com/DioxusLabs/dioxus/blob/9ebcbc6bd9e1b1af9b141d2dd8ed6c816b42607e/packages/html/src/events/drag.rs#L247 defines ondrop through the macro. I am not yet able to follow the macro's logic of converting from web_sys events into dioxus events, but I do know from experimentation that ondrop is getting a dioxus::DragEvent that downcasts to web_sys::MouseEvent, that somehow has files, rather than a web_sys::DragEvent. See code in thread.
This is a problem for me because I am doing things that the current HasFileData does not seem to support, specifically directory handling (webkitdirectory), and I want to loop over the files with their full directory paths. Right now I only get the name of the folder dropped, not the full list of files with paths, as I would expect to be the case per (related but not quite the same): https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory#understanding_the_results
Perhaps there is some place in dioxus where the directory items are gotten from drops ala https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/File_drag_and_drop#process_the_drop ?
As per previous discussion e.g. by @leaden nebula ala https://github.com/DioxusLabs/dioxus/pull/2323#pullrequestreview-2055565567 this is further evidence that a better file interface needs to be developed, but for now, I'm comfortable figuring out parts of that interface by building it manually for just my application, and then I'll happily migrate it over to dioxus itself.
But I'd still like to know if this is deliberate for some reason or a bug/missed feature, somehow. Perhaps the solution is simply to "fix" drag & drop event files to have the full paths as per the above, or perhaps it is to downcast to DragEvent instead of MouseEvent (tho, perhaps relevantly, DragEvent inherits from MouseEvent per MDN)
The HTMLInputElement.webkitdirectory is a property
that reflects the webkitdirectory HTML attribute
and indicates that the element should let the user select directories instead of files.
When a directory is selected, the directory and its entire hierarchy of contents are included in the set of selected items.
The selected file system e...
This allows file sizes to be checked before loading the entire file into memory (e.g. with read_file) when it might be too big. (And without requesting the native file to do this check manually.)
HTML Drag and Drop interfaces enable web applications to drag and drop files on a web page. This document describes how an application can accept one or more files that are dragged from the underlying platform's file manager and dropped on a web page.