touchend

Commons
stable

Handle the `touchend` phase of a gesture: record the ending X/Y coordinates, call the optional `end` callback, then delegate to `handleGesture` to fire the directional callbacks (left, right, up, down).

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

event
requis
TouchEvent
The native TouchEvent fired by the browser. `changedTouches[0]` is used to read the end position.
wrapper
requis
TTouchWrapper
The shared gesture state object. `touchendX` and `touchendY` are written; `wrapper.end` is called when defined, then `handleGesture` evaluates the directional callbacks.

API

Valeur de retour

La valeur retournée par cet util.

Side-effectful — mutates the wrapper and fires callbacks. Returns nothing.

Usage

Exemples

Extraits de code prêts à coller.

Detect a left swipe with touchend

typescript