Edit this page

up.viewport up.viewport.restoreFocus([viewport], [options])
JavaScript function

This feature is experimental. Please share your experiences so we know what to keep or change.

Restores previously saved focus-related state.

Unpoly automatically restores focus-related state when the user presses the back button.


Parameters

[viewport] ElementorArray<Element> optional

The viewports for which to restore focus-related state..

Defaults to all viewports within the given layer.

[options.layer='current'] up.Layerorstring optional

The layer on which to restore focus-related state.

[options.location] string optional

The URL for which to restore focus-related state.

If omitted, the given layer's location is used.

Return value

boolean

Returns whether focus state could be restored.