MCPcopy Create free account
hub / github.com/angular/components / isTouchEvent

Function isTouchEvent

src/cdk/drag-drop/drag-ref.ts:1671–1676  ·  view source on GitHub ↗

Determines whether an event is a touch event.

(event: MouseEvent | TouchEvent)

Source from the content-addressed store, hash-verified

1669
1670/** Determines whether an event is a touch event. */
1671function isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEvent {
1672 // This function is called for every pixel that the user has dragged so we need it to be
1673 // as fast as possible. Since we only bind mouse events and touch events, we can assume
1674 // that if the event's name starts with `t`, it's a touch event.
1675 return event.type[0] === 't';
1676}
1677
1678/** Callback invoked for `selectstart` events inside the shadow DOM. */
1679function shadowDomSelectStart(event: Event) {

Callers 5

_startDragSequenceMethod · 0.85
_getDragStartDelayMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected