The Focus Manager

The singleton object focusManager provides a set of read-only properties that indicate which current and previous DOM node has/had the focus and which Component has the focus. Further, focusManager is an instance of EventHub and defines several events that are fired when the focus changes.

A Component instance is said to hold the focus if it contains a DOM node its DOM rendering that holds the focus, or if it contains a Component instance in its child collection that holds the focus. Notice that the path from a child Component that directly contains a DOM node that holds the focus in its rendering to it's furthest ancestor may indicate several Component instances that hold the focus. This path is termed the "focus stack". On the other had, at any instant in time, at most one DOM node can hold the focus.

Superclasses

focusManager is an instance of EventHub.

Public Properties

get focusedComponent() [Component | undefined]

The Component instance that contains a DOM node in its rendering that currently holds the focus; undefined if no such component exists.

get focusedNode() [DOM node | undefined]

The DOM node that currently holds the focus; undefined if no such node exists.

get focusedStack() [Array of Component]

The path of Component instances that currently hold the focus.

get previousFocusedComponent() [Component | undefined]

The previous Component instance that contained a DOM node in its rendering the instant before the most recent focus change; undefined if no such component exists.

Events

blurComponent

Fired when a Component instance loses the focus. The event object contains the Component instance at the property component.

blurComponent

Fired when a Component instance gains the focus. The event object contains the Component instance at the property component.

focusedComponent

Fired after all mutations of the focus stack have been completed and all public properties of the focusManager singleton have been updated. The event object contains the Component instance that contains the DOM node that holds the focus at the property component.