Quartz Headless docs/createFocusRestorer

Search documentation

Type to search the documentation.

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.

Signature

function createFocusRestorer(document: Document): FocusRestorer
Parameter Type Optional Description
document Document

Returns FocusRestorer