Skip to main content

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​

Methods index​

MethodDescription
getFirstChildReturns null since fields do not have children.
getParentReturns the parent block of the given field.
getNextSiblingReturns the next field or input following the given field.
getPreviousSiblingReturns the field or input preceding the given field.
getRowIdReturns the row ID of the given field.
isNavigableReturns whether or not the given field can be navigated to.
isApplicableReturns 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​

ParameterTypeDescription
_currentField<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​

ParameterTypeDescription
currentField<any>The field to navigate from.

Returns​

IFocusableNode | null

The given field's parent block.

Implementation of​

INavigationPolicy.getParent


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​

ParameterTypeDescription
currentField<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​

ParameterTypeDescription
currentField<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​

ParameterTypeDescription
currentField<any>The field to retrieve the row ID of.

Returns​

string

The row ID of the given field.

Implementation of​

INavigationPolicy.getRowId


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​

ParameterTypeDescription
currentField<any>The instance to check for navigability.

Returns​

boolean

True if the given field can be focused and navigated to.

Implementation of​

INavigationPolicy.isNavigable


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​

ParameterTypeDescription
currentanyThe object to check if this policy applies to.

Returns​

current is Field<any>

True if the object is a Field.

Implementation of​

INavigationPolicy.isApplicable