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

Function isTouchEvent

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

Determines whether an event is a touch event.

(event: MouseEvent | TouchEvent)

Source from the content-addressed store, hash-verified

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

Callers 5

_startDragSequenceMethod · 0.85
_getDragStartDelayMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected