MCPcopy Create free account
hub / github.com/ampproject/amphtml / handler

Function handler

src/preact/hooks/useClickOutside.tsx:21–26  ·  view source on GitHub ↗
(ev: MouseEvent)

Source from the content-addressed store, hash-verified

19 }
20
21 const handler = (ev: MouseEvent) => {
22 const element = elementRef.current;
23 if (element && !shadowContains(element, ev.target as Element)) {
24 cb(ev);
25 }
26 };
27 const document = elementRef.current.ownerDocument;
28 document.addEventListener('click', handler, {capture: true});
29 return () => {

Callers

nothing calls this directly

Calls 2

shadowContainsFunction · 0.85
cbFunction · 0.50

Tested by

no test coverage detected