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

Function withElementFromPoint

test/helpers/environment.ts:11–19  ·  view source on GitHub ↗
(
  elementFromPoint: HTMLElement,
  callback: () => void,
)

Source from the content-addressed store, hash-verified

9}
10
11export function withElementFromPoint(
12 elementFromPoint: HTMLElement,
13 callback: () => void,
14) {
15 const originalElementFromPoint = document.elementFromPoint;
16 document.elementFromPoint = () => elementFromPoint;
17 callback();
18 document.elementFromPoint = originalElementFromPoint;
19}
20
21export const REQUEST_ANIMATION_FRAME_TIMEOUT = 15;
22

Callers 1

triggerEventFunction · 0.90

Calls 1

callbackFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…