fix scroll data (#569)

This commit is contained in:
Demonthos 2022-09-30 12:48:52 -05:00 committed by GitHub
parent 964a942243
commit b32fd2d2cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View file

@ -105,7 +105,7 @@ fn make_synthetic_event(name: &str, val: serde_json::Value) -> Arc<dyn Any + Sen
Arc::new(serde_json::from_value::<TouchData>(val).unwrap()) Arc::new(serde_json::from_value::<TouchData>(val).unwrap())
} }
"scroll" => Arc::new(()), "scroll" => Arc::new(ScrollData {}),
"wheel" => Arc::new(serde_json::from_value::<WheelData>(val).unwrap()), "wheel" => Arc::new(serde_json::from_value::<WheelData>(val).unwrap()),

View file

@ -250,9 +250,6 @@ pub mod on {
/// onmouseout /// onmouseout
onmouseout onmouseout
///
onscroll
/// onmouseover /// onmouseover
/// ///
/// Triggered when the users's mouse hovers over an element. /// Triggered when the users's mouse hovers over an element.
@ -262,6 +259,11 @@ pub mod on {
onmouseup onmouseup
]; ];
ScrollEvent(ScrollData): [
///
onscroll
];
PointerEvent(PointerData): [ PointerEvent(PointerData): [
/// pointerdown /// pointerdown
onpointerdown onpointerdown
@ -897,6 +899,11 @@ pub mod on {
} }
} }
pub type ScrollEvent = UiEvent<ScrollData>;
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone)]
pub struct ScrollData {}
pub type MediaEvent = UiEvent<MediaData>; pub type MediaEvent = UiEvent<MediaData>;
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone)] #[derive(Debug, Clone)]