Skip to main content

blockly > FocusManager > focusNode

FocusManager.focusNode() method

Focuses DOM input on the specified node, and marks it as actively focused.

Any previously focused node will be updated to be passively highlighted (if it's in a different focusable tree) or blurred (if it's in the same one).

**Important**: If the provided node is not able to be focused (e.g. its canBeFocused() method returns false), it will be ignored and any existing focus state will remain unchanged.

Note that this may update the specified node's element's tabindex to ensure that it can be properly read out by screenreaders while focused.

The focused node will not be automatically scrolled into view.

Signature:

focusNode(focusableNode: IFocusableNode): void;

Parameters

Parameter

Type

Description

focusableNode

IFocusableNode

The node that should receive active focus.

Returns:

void