use DragEvent not MouseEvent for drag events (#3137)

* use DragEvent not MouseEvent for drag events

* Simplify drag events and remove WebDragData struct

* use DragEvent not MouseEvent for drag events

* re-add the web_sys event reference for drag + mouse data

* remove now vestigial impls for MouseEvent

---------

Co-authored-by: Matt Hunzinger <matthunz2@gmail.com>
This commit is contained in:
Chris RogusandMatt Hunzinger authored and GitHub committed 2024-10-31 09:44:27 -05:00
1 parent 5d99889728
commit e5a1a62644
18 files changed
+83 -94

No files matched your search

+3 -2
View File
@@ -1,7 +1,6 @@
use dioxus_html::{
DragData, FormData, HtmlEventConverter, ImageData, MountedData, PlatformEventData,
};
use drag::WebDragData;
use form::WebFormData;
use load::WebImageEvent;
use wasm_bindgen::JsCast;
@@ -78,7 +77,9 @@ impl HtmlEventConverter for WebEventConverter {
#[inline(always)]
fn convert_drag_data(&self, event: &dioxus_html::PlatformEventData) -> dioxus_html::DragData {
let event = downcast_event(event);
DragData::new(WebDragData::new(event.raw.clone().unchecked_into()))
DragData::new(Synthetic::new(
event.raw.clone().unchecked_into::<web_sys::DragEvent>(),
))
}
#[inline(always)]