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
| Method | Description |
|---|---|
| getFirstChild | Returns the first child of the given block. |
| getParent | Returns the parent of the given block. |
| getNextSibling | Returns the next peer node of the given block. |
| getPreviousSibling | Returns the previous peer node of the given block. |
| getRowId | Returns the visual row ID of the given block. |
| isNavigable | Returns whether or not the given block can be navigated to. |
| isApplicable | Returns 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
| Parameter | Type | Description |
|---|---|---|
current | BlockSvg | The 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
| Parameter | Type | Description |
|---|---|---|
current | BlockSvg | The 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
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
| Parameter | Type | Description |
|---|---|---|
current | BlockSvg | The 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
| Parameter | Type | Description |
|---|---|---|
current | BlockSvg | The 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
| Parameter | Type | Description |
|---|---|---|
current | BlockSvg | The block to retrieve the row ID of. |
Returns
string
The row ID of the given block.
Implementation of
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
| Parameter | Type | Description |
|---|---|---|
current | BlockSvg | The instance to check for navigability. |
Returns
boolean
True if the given block can be focused.
Implementation of
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
| Parameter | Type | Description |
|---|---|---|
current | any | The object to check if this policy applies to. |
Returns
current is BlockSvg
True if the object is a BlockSvg.