MCPcopy
hub / github.com/react-dnd/react-dnd / eventShouldStartDrag

Function eventShouldStartDrag

packages/backend-touch/src/utils/predicates.ts:19–23  ·  view source on GitHub ↗
(e: MouseEvent)

Source from the content-addressed store, hash-verified

17 * @param {MouseEvent | TouchEvent} e The event
18 */
19export function eventShouldStartDrag(e: MouseEvent): boolean {
20 // For touch events, button will be undefined. If e.button is defined,
21 // then it should be MouseButton.Left.
22 return e.button === undefined || e.button === MouseButton.Left
23}
24
25/**
26 * Only touch events and mouse events where the left mouse button is no longer held should end a drag.

Callers 1

TouchBackendImplClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…