diff --git a/src/cdk/drag-drop/drag-ref.ts b/src/cdk/drag-drop/drag-ref.ts index eec1886eae80..34dc1c1c4fb3 100644 --- a/src/cdk/drag-drop/drag-ref.ts +++ b/src/cdk/drag-drop/drag-ref.ts @@ -1113,7 +1113,10 @@ function removeElement(element: HTMLElement | null) { /** Determines whether an event is a touch event. */ function isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEvent { - return event.type.startsWith('touch'); + // This function is called for every pixel that the user has dragged so we need it to be + // as fast as possible. Since we only bind mouse events and touch events, we can assume + // that if the event's name starts with `t`, it's a touch event. + return event.type[0] === 't'; } /** Gets the element into which the drag preview should be inserted. */