Class: FieldNavigationPolicy
Defined in: packages/blockly/core/keyboard_nav/navigation_policies/field_navigation_policy.ts:16
Set of rules controlling keyboard navigation from a field.
Implements
INavigationPolicy<Field<any>>
Methods index
| Method | Description |
|---|---|
| getFirstChild | Returns null since fields do not have children. |
| getParent | Returns the parent block of the given field. |
| getNextSibling | Returns the next field or input following the given field. |
| getPreviousSibling | Returns the field or input preceding the given field. |
| getRowId | Returns the row ID of the given field. |
| isNavigable | Returns whether or not the given field can be navigated to. |
| isApplicable | Returns whether the given object can be navigated from by this policy. |
Constructors
Constructor
new FieldNavigationPolicy(): FieldNavigationPolicy;
Returns
FieldNavigationPolicy
Methods
getFirstChild()
getFirstChild(_current): IFocusableNode | null;
Defined in: packages/blockly/core/keyboard_nav/navigation_policies/field_navigation_policy.ts:23
Returns null since fields do not have children.
Parameters
| Parameter | Type | Description |
|---|---|---|
_current | Field<any> | The field to navigate from. |
Returns
IFocusableNode | null
Null.
Implementation of
INavigationPolicy.getFirstChild
getParent()
getParent(current): IFocusableNode | null;
Defined in: packages/blockly/core/keyboard_nav/navigation_policies/field_navigation_policy.ts:33
Returns the parent block of the given field.
Parameters
| Parameter | Type | Description |
|---|---|---|
current | Field<any> | The field to navigate from. |
Returns
IFocusableNode | null
The given field's parent block.
Implementation of
getNextSibling()
getNextSibling(current): IFocusableNode | null;
Defined in: packages/blockly/core/keyboard_nav/navigation_policies/field_navigation_policy.ts:43
Returns the next field or input following the given field.
Parameters
| Parameter | Type | Description |
|---|---|---|
current | Field<any> | The field to navigate from. |
Returns
IFocusableNode | null
The next field or input in the given field's block.
Implementation of
INavigationPolicy.getNextSibling
getPreviousSibling()
getPreviousSibling(current): IFocusableNode | null;
Defined in: packages/blockly/core/keyboard_nav/navigation_policies/field_navigation_policy.ts:53
Returns the field or input preceding the given field.
Parameters
| Parameter | Type | Description |
|---|---|---|
current | Field<any> | The field to navigate from. |
Returns
IFocusableNode | null
The preceding field or input in the given field's block.
Implementation of
INavigationPolicy.getPreviousSibling
getRowId()
getRowId(current): string;
Defined in: packages/blockly/core/keyboard_nav/navigation_policies/field_navigation_policy.ts:63
Returns the row ID of the given field.
Parameters
| Parameter | Type | Description |
|---|---|---|
current | Field<any> | The field to retrieve the row ID of. |
Returns
string
The row ID of the given field.
Implementation of
isNavigable()
isNavigable(current): boolean;
Defined in: packages/blockly/core/keyboard_nav/navigation_policies/field_navigation_policy.ts:73
Returns whether or not the given field can be navigated to.
Parameters
| Parameter | Type | Description |
|---|---|---|
current | Field<any> | The instance to check for navigability. |
Returns
boolean
True if the given field can be focused and navigated to.
Implementation of
isApplicable()
isApplicable(current): current is Field<any>;
Defined in: packages/blockly/core/keyboard_nav/navigation_policies/field_navigation_policy.ts:92
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 Field<any>
True if the object is a Field.