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

Function isOverTarget

packages/react-aria/src/interactions/usePress.ts:1142–1146  ·  view source on GitHub ↗
(point: EventPoint, target: Element)

Source from the content-addressed store, hash-verified

1140}
1141
1142function isOverTarget(point: EventPoint, target: Element) {
1143 let rect = target.getBoundingClientRect();
1144 let pointRect = getPointClientRect(point);
1145 return areRectanglesOverlapping(rect, pointRect);
1146}
1147
1148function shouldPreventDefaultUp(target: Element) {
1149 if (target instanceof HTMLInputElement) {

Callers 1

usePressFunction · 0.85

Calls 2

getPointClientRectFunction · 0.85
areRectanglesOverlappingFunction · 0.85

Tested by

no test coverage detected