Function freya_elements::elements::events::ontouchstart

source ·
pub fn ontouchstart<E: EventReturn<T>, T>(
    _f: impl FnMut(Event<TouchData>) -> E + 'static
) -> Attribute
Expand description

The touchstart event fires when the user starts touching an element.

Event Data: TouchData

§Example

fn app() -> Element {
    rsx!(
        rect {
            width: "100",
            height: "100",
            background: "red",
            ontouchstart: |_| println!("Started touching!")
        }
    )
}