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

Function getActiveTarget

src/document/patchFocus.ts:87–90  ·  view source on GitHub ↗
(document: Document)

Source from the content-addressed store, hash-verified

85}
86
87function getActiveTarget(document: Document) {
88 const active = getActiveElement(document)
89 return active?.tagName === 'BODY' ? null : active
90}
91
92export function restoreFocus(HTMLElement: typeof globalThis['HTMLElement']) {
93 if (HTMLElement.prototype[patched]) {

Callers 2

patchedFocusFunction · 0.85
patchedBlurFunction · 0.85

Calls 1

getActiveElementFunction · 0.90

Tested by

no test coverage detected