Skip to content

Commit

Permalink
fix(core): fix wrong file drop events (#2300)
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianLars committed Jul 30, 2021
1 parent 426a6b4 commit c2b0fe1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changes/fix-file-drop-events.md
@@ -0,0 +1,6 @@
---
"tauri": patch
"api": patch
---

Fixes file drop events being swapped (`file-drop-hover` on drop and `file-drop` on hover).
4 changes: 2 additions & 2 deletions core/tauri/src/manager.rs
Expand Up @@ -396,8 +396,8 @@ impl<R: Runtime> WindowManager<R> {
crate::async_runtime::block_on(async move {
let window = Window::new(manager.clone(), window, app_handle);
let _ = match event {
FileDropEvent::Hovered(paths) => window.emit("tauri://file-drop", Some(paths)),
FileDropEvent::Dropped(paths) => window.emit("tauri://file-drop-hover", Some(paths)),
FileDropEvent::Hovered(paths) => window.emit("tauri://file-drop-hover", Some(paths)),
FileDropEvent::Dropped(paths) => window.emit("tauri://file-drop", Some(paths)),
FileDropEvent::Cancelled => window.emit("tauri://file-drop-cancelled", Some(())),
_ => unimplemented!(),
};
Expand Down

0 comments on commit c2b0fe1

Please sign in to comment.