chore: iron out all events

This commit is contained in:
Jonathan Kelley committed 2022-11-21 17:15:17 -08:00
1 parent 491bf4332d
commit 08ca068d1c
15 files changed
+360 -1645

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
use std::any::Any;
use dioxus_core::UiEvent;
use crate::MouseData;
pub type DragEvent = UiEvent<DragData>;
/// The DragEvent interface is a DOM event that represents a drag and drop interaction. The user initiates a drag by
/// placing a pointer device (such as a mouse) on the touch surface and then dragging the pointer to a new location
/// (such as another DOM element). Applications are free to interpret a drag and drop interaction in an
/// application-specific way.
pub struct DragData {
/// Inherit mouse data
pub mouse: MouseData,
/// And then add the rest of the drag data
pub data: Box<dyn Any>,
}
impl_event! {
DragData;
/// ondrag
ondrag
/// ondragend
ondragend
/// ondragenter
ondragenter
/// ondragexit
ondragexit
/// ondragleave
ondragleave
/// ondragover
ondragover
/// ondragstart
ondragstart
/// ondrop
ondrop
}