isTouchEvent

Commons
stable

Type guard that narrows a TRippleEvent to TouchEvent by checking constructor.name. Used internally by the ripple system to position the ripple at the touch contact point.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

e
required
TRippleEvent
The event to classify, typed as TRippleEvent (union of MouseEvent, TouchEvent, KeyboardEvent). The check uses constructor.name for reliable cross-frame detection.

API

Return value

The value returned by this util.

true and narrows e to TouchEvent when the event originated from a touch gesture; false for mouse and keyboard events.

Usage

Examples

Ready-to-paste usage snippets.

Detecting touch to set ripple origin

typescript