pub type TouchEvent = Event<TouchData>;
struct TouchEvent {
pub data: Rc<TouchData>,
}
The data associated with this event
Implementations
Map the event data to a new type
§Example
ⓘrsx! {
button {
onclick: move |evt: Event<FormData>| {
let data = evt.map(|data| data.value());
assert_eq!(data.inner(), "hello world");
}
}
}
👎Deprecated: use stop_propagation instead
Prevent this event from continuing to bubble up the tree to parent elements.
§Example
ⓘrsx! {
button {
onclick: move |evt: Event<MouseData>| {
evt.cancel_bubble();
}
}
}
Prevent this event from continuing to bubble up the tree to parent elements.
§Example
ⓘrsx! {
button {
onclick: move |evt: Event<MouseData>| {
evt.stop_propagation();
}
}
}
Get a reference to the inner data from this event
ⓘrsx! {
button {
onclick: move |evt: Event<MouseData>| {
let data = evt.inner.clone();
cx.spawn(async move {
println!("{:?}", data);
});
}
}
}
Trait Implementations
Performs copy-assignment from
source
.
Read more
Formats the value using the given formatter.
Read more
The resulting type after dereferencing.
Dereferences the value.