Skip to main content

blockly > Navigator

Class responsible for determining where focus should move in response to keyboard navigation commands.

Signature:

export declare class Navigator

Properties

Property

Modifiers

Type

Description

navigationLoops

protected

boolean

Whether or not navigation loops around when reaching the end.

rules

protected

RuleList<any>

Map from classes to a corresponding ruleset to handle navigation from instances of that class.

Methods

Method

Modifiers

Description

addNavigationPolicy(policy)

Adds a navigation ruleset to this Navigator.

getFirstChild(current)

Returns the first child of the given object instance, if any.

getFirstNode()

Get the first navigable node on the workspace, or null if none exist.

getInNode(node)

Returns the node to the right of the given node.

getLastNode()

Get the last navigable node on the workspace, or null if none exist.

getNavigationLoops()

Returns whether or not navigation loops around when reaching the end of the workspace.

getNextNode(node)

Returns next node relative to the given node.

getNextSibling(current)

Returns the next sibling of the given object instance, if any.

getOutNode(node)

Returns the node to the left of the given node.

getParent(current)

Returns the parent of the given object instance, if any.

getPreviousNode(node)

Returns the previous node relative to the given node.

getPreviousSibling(current)

Returns the previous sibling of the given object instance, if any.

getSourceBlockFromNode(node)

Returns the block that the given node is a child of.

getTopLevelItems(current)

protected

Returns a list of all top-level focusable items on the given node's focusable tree.

isNavigable(node)

protected

Returns whether or not the given node is navigable.

setNavigationLoops(loops)

Sets whether or not navigation should loop around when reaching the end of the workspace.

transitionAllowed(current, candidate, direction)

protected

Determines whether navigation is allowed between two nodes.