* 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>
19 lines
459 B
Rust
19 lines
459 B
Rust
use super::{Synthetic, WebEventExt};
|
|
use dioxus_html::HasToggleData;
|
|
|
|
impl HasToggleData for Synthetic<web_sys::Event> {
|
|
fn as_any(&self) -> &dyn std::any::Any {
|
|
&self.event
|
|
}
|
|
}
|
|
|
|
impl WebEventExt for dioxus_html::ToggleData {
|
|
type WebEvent = web_sys::Event;
|
|
|
|
#[inline(always)]
|
|
fn try_as_web_event(&self) -> Option<Self::WebEvent> {
|
|
self.downcast::<Synthetic<web_sys::Event>>()
|
|
.map(|e| e.event.clone())
|
|
}
|
|
}
|