prevent_default must be called synchronously or it will have no effect (#4386)
This commit is contained in:
1 parent
1a494d1f5e
commit
97947b169b
1 file changed
+3
-1
@@ -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() {
|
||||
spawn(async move {
|
||||
read_files(file_engine).await;
|
||||
});
|
||||
}
|
||||
},
|
||||
"Drop files here"
|
||||
|
||||
Reference in new issue
Block a user