datatransfer object, drag_and_drop example, fix drag-and-drop (#4789)

* wip: implement datatransfer

* Editable kanban contents

* desktop sorta works without crashing

* lint
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2025-10-15 01:06:13 -07:00
1 parent 7856679641
commit 0aa7351473
13 files changed
+562 -122

No files matched your search

+6 -5
View File
@@ -155,16 +155,17 @@ impl WebviewEdits {
}
dioxus_html::EventData::Drag(ref drag) => {
// we want to override this with a native file engine, provided by the most recent drag event
let file_event = hovered_file.current().unwrap();
let paths = match file_event {
wry::DragDropEvent::Enter { paths, .. } => paths,
wry::DragDropEvent::Drop { paths, .. } => paths,
let file_event = hovered_file.current();
let file_paths = match file_event {
Some(wry::DragDropEvent::Enter { paths, .. }) => paths,
Some(wry::DragDropEvent::Drop { paths, .. }) => paths,
_ => vec![],
};
Rc::new(PlatformEventData::new(Box::new(DesktopFileDragEvent {
mouse: drag.mouse.clone(),
files: paths,
data_transfer: drag.data_transfer.clone(),
files: file_paths,
})))
}
_ => data.into_any(),