blockly > FocusableTreeTraverser > findFocusedNode

FocusableTreeTraverser.findFocusedNode() method

Returns the current IFocusableNode that is styled (and thus represented) as having either passive or active focus, only considering HTML and SVG elements.

This can match against the tree's root.

Note that this will never return a node from a nested sub-tree as that tree should specifically be used to retrieve its focused node.

Signature:

static findFocusedNode(tree: IFocusableTree): IFocusableNode | null;

Parameters

Parameter Type Description
tree IFocusableTree The IFocusableTree in which to search for a focused node.

Returns:

IFocusableNode | null

The IFocusableNode currently with focus, or null if none.