MCPcopy Create free account
hub / github.com/adobe/react-spectrum / onPointerMove

Function onPointerMove

packages/react-aria/src/tooltip/useSafeArea.ts:61–69  ·  view source on GitHub ↗
(e: PointerEvent)

Source from the content-addressed store, hash-verified

59 }
60
61 let onPointerMove = (e: PointerEvent) => {
62 if (e.pointerType === 'touch') {
63 return;
64 }
65 let point = {x: e.clientX, y: e.clientY};
66 let triggerRect = trigger!.getBoundingClientRect();
67 let overlayRect = overlayRef.current?.getBoundingClientRect();
68 onSafeAreaChange(isPointInSafeArea(point, triggerRect, overlayRect));
69 };
70
71 // If the pointer leaves the document entirely, it is no longer in the safe area.
72 let onPointerLeave = () => onSafeAreaChange(false);

Callers

nothing calls this directly

Calls 1

isPointInSafeAreaFunction · 0.85

Tested by

no test coverage detected