Function freya::elements::ontouchcancel

source ·
pub fn ontouchcancel<'a>(
    _cx: &'a ScopeState,
    _f: impl FnMut(Event<TouchData>) + 'a
) -> Attribute<'a>
Expand description

The touchcancel event will fire when the user cancels the touching, this is usually caused by the hardware or the OS.

Event Data: TouchData

Example:

fn app(cx: Scope) -> Element {
    render!(
        rect {
            width: "100",
            height: "100",
            background: "red",
            ontouchcancel: |_| println!("Touching canceled!")
        }
    )
}