blockly > FocusManager > registerTree
FocusManager.registerTree() method
Registers a new IFocusableTree for automatic focus management.
If the tree currently has an element with DOM focus, it will not affect the internal state in this manager until the focus changes to a new, now-monitored element/node.
This function throws if the provided tree is already currently registered in this manager. Use isRegistered to check in cases when it can't be certain whether the tree has been registered.
The tree's registration can be customized to configure automatic tab stops. This specifically provides capability for the user to be able to tab navigate to the root of the tree but only when the tree doesn't hold active focus. If this functionality is disabled then the tree's root will automatically be made focusable (but not tabbable) when it is first focused in the same way as any other focusable node.
Signature:
registerTree(tree: IFocusableTree, rootShouldBeAutoTabbable?: boolean): void;
Parameters
| Parameter | Type | Description |
|---|---|---|
| tree | IFocusableTree | The IFocusableTree to register. |
| rootShouldBeAutoTabbable | boolean | (Optional) Whether the root of this tree should be added as a top-level page tab stop when it doesn't hold active focus. |
Returns:
void