Skip to main content

Class: BlockNavigationPolicy

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/block_navigation_policy.ts:16

Set of rules controlling keyboard navigation from a block.

Implements

Methods index

MethodDescription
getFirstChildReturns the first child of the given block.
getParentReturns the parent of the given block.
getNextSiblingReturns the next peer node of the given block.
getPreviousSiblingReturns the previous peer node of the given block.
getRowIdReturns the visual row ID of the given block.
isNavigableReturns whether or not the given block can be navigated to.
isApplicableReturns whether the given object can be navigated from by this policy.

Constructors

Constructor

new BlockNavigationPolicy(): BlockNavigationPolicy;

Returns

BlockNavigationPolicy

Methods

getFirstChild()

getFirstChild(current): IFocusableNode | null;

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/block_navigation_policy.ts:23

Returns the first child of the given block.

Parameters

ParameterTypeDescription
currentBlockSvgThe block to return the first child of.

Returns

IFocusableNode | null

The first icon, field, or input of the given block, if any.

Implementation of

INavigationPolicy.getFirstChild


getParent()

getParent(current): IFocusableNode | null;

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/block_navigation_policy.ts:34

Returns the parent of the given block.

Parameters

ParameterTypeDescription
currentBlockSvgThe block to return the parent of.

Returns

IFocusableNode | null

The top block of the given block's stack, or the connection to which it is attached.

Implementation of

INavigationPolicy.getParent


getNextSibling()

getNextSibling(current): IFocusableNode | null;

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/block_navigation_policy.ts:52

Returns the next peer node of the given block.

Parameters

ParameterTypeDescription
currentBlockSvgThe block to find the following element of.

Returns

IFocusableNode | null

The block's next connection, or the next peer on its parent block, otherwise null.

Implementation of

INavigationPolicy.getNextSibling


getPreviousSibling()

getPreviousSibling(current): IFocusableNode | null;

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/block_navigation_policy.ts:70

Returns the previous peer node of the given block.

Parameters

ParameterTypeDescription
currentBlockSvgThe block to find the preceding element of.

Returns

IFocusableNode | null

The block's previous connection, or the previous peer on its parent block, otherwise null.

Implementation of

INavigationPolicy.getPreviousSibling


getRowId()

getRowId(current): string;

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/block_navigation_policy.ts:90

Returns the visual row ID of the given block.

Parameters

ParameterTypeDescription
currentBlockSvgThe block to retrieve the row ID of.

Returns

string

The row ID of the given block.

Implementation of

INavigationPolicy.getRowId


isNavigable()

isNavigable(current): boolean;

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/block_navigation_policy.ts:100

Returns whether or not the given block can be navigated to.

Parameters

ParameterTypeDescription
currentBlockSvgThe instance to check for navigability.

Returns

boolean

True if the given block can be focused.

Implementation of

INavigationPolicy.isNavigable


isApplicable()

isApplicable(current): current is BlockSvg;

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/block_navigation_policy.ts:110

Returns whether the given object can be navigated from by this policy.

Parameters

ParameterTypeDescription
currentanyThe object to check if this policy applies to.

Returns

current is BlockSvg

True if the object is a BlockSvg.

Implementation of

INavigationPolicy.isApplicable