touchmove

Commons
stable

Handle the `touchmove` phase of a gesture: record the current pointer X/Y coordinates and call the optional `move` callback on the wrapper.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

event
required
TouchEvent
The native TouchEvent. `changedTouches[0]` is read for the current position.
wrapper
required
TTouchWrapper
The shared gesture state object. `touchmoveX` and `touchmoveY` are written; `wrapper.move` is called when defined.

API

Return value

The value returned by this util.

Side-effectful — mutates the wrapper and calls the optional move callback. Returns nothing.

Usage

Examples

Ready-to-paste usage snippets.

Track pointer position during a drag

typescript