MCPcopy Create free account
hub / github.com/testing-library/user-event / hasPointerEvents

Function hasPointerEvents

src/utils/misc/hasPointerEvents.ts:18–33  ·  view source on GitHub ↗
(element: Element)

Source from the content-addressed store, hash-verified

16}
17
18export function hasPointerEvents(element: Element): boolean {
19 const window = getWindowFromNode(element)
20
21 for (
22 let el: Element | null = element;
23 el?.ownerDocument;
24 el = el.parentElement
25 ) {
26 const pointerEvents = window.getComputedStyle(el).pointerEvents
27 if (pointerEvents && !['inherit', 'unset'].includes(pointerEvents)) {
28 return pointerEvents !== 'none'
29 }
30 }
31
32 return true
33}

Callers 6

hoverFunction · 0.90
unhoverFunction · 0.90
selectOptionsBaseFunction · 0.90
clickFunction · 0.90
dblClickFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected