MCPcopy
hub / github.com/Shopify/draggable / drag

Function drag

test/helpers/module.ts:21–43  ·  view source on GitHub ↗
({from, to, sensor = 'mouse'}: Options)

Source from the content-addressed store, hash-verified

19}
20
21export function drag({from, to, sensor = 'mouse'}: Options) {
22 if (sensor === 'mouse') {
23 clickMouse(from);
24 waitForDragDelay();
25 moveMouse(to);
26 releaseMouse(to);
27 } else if (sensor === 'touch') {
28 touchStart(from);
29 waitForDragDelay();
30 touchMove(to);
31 touchRelease(to);
32 } else if (sensor === 'drag') {
33 clickMouse(from);
34 waitForDragDelay();
35 dragStart(from);
36 waitForDragDelay();
37 dragOver(to);
38 dragDrop(to);
39 dragStop(to);
40 } else {
41 throw new Error(`Sensor '${sensor}' is not yet implemented`);
42 }
43}

Callers 1

Calls 11

clickMouseFunction · 0.90
waitForDragDelayFunction · 0.90
moveMouseFunction · 0.90
releaseMouseFunction · 0.90
touchStartFunction · 0.90
touchMoveFunction · 0.90
touchReleaseFunction · 0.90
dragStartFunction · 0.90
dragOverFunction · 0.90
dragDropFunction · 0.90
dragStopFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…