API: Core
createFocusRestorer
Captures the currently focused element and returns a restorer for it.
Overview
Captures the currently focused element and returns a restorer for it. restore() is a
no-op when the captured element was removed from the document, became unfocusable, or was
never a real target (body/documentElement) โ it never throws and never reclaims focus
for a destroyed target.
- Kind: Function
- Source: packages/core/src/focus/focus.ts:118
Signature
function createFocusRestorer(document: Document): FocusRestorer
| Parameter | Type | Optional | Description |
|---|---|---|---|
document |
Document |
Returns FocusRestorer