Skip to content

@jsvision/ui / FocusHostAware

Interface: FocusHostAware

Defined in: ui/src/router/types.ts:98

Implemented by an application body (e.g. a router) that saves/restores focus across navigation. When such a body is passed as createApplication({ content }), the application hands it a FocusHost once the loop exists. A body that does not implement this is left untouched.

Example

ts
import { Group } from '@jsvision/ui';

class Router extends Group {
  private focus: FocusHost | null = null;
  attachFocusHost(host: FocusHost): void { this.focus = host; }
}

Methods

attachFocusHost()

attachFocusHost(host): void

Defined in: ui/src/router/types.ts:104

Receive the application's focus seam. Called once by createApplication after the loop is built.

Parameters

host

FocusHost

The focus seam that moves and reads keyboard focus.

Returns

void