prevent_default must be called synchronously or it will have no effect (#4386)

This commit is contained in:
Shoshána Abigail authored and GitHub committed 2025-07-09 12:22:29 -04:00
1 parent 1a494d1f5e
commit 97947b169b
1 file changed
+4 -2
+4 -2
View File
@@ -79,11 +79,13 @@ fn app() -> Element {
hovered.set(true)
},
ondragleave: move |_| hovered.set(false),
ondrop: move |evt| async move {
ondrop: move |evt| {
evt.prevent_default();
hovered.set(false);
if let Some(file_engine) = evt.files() {
read_files(file_engine).await;
spawn(async move {
read_files(file_engine).await;
});
}
},
"Drop files here"