Skip to main content

Class: IconNavigationPolicy

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

Set of rules controlling keyboard navigation from an icon.

Implements​

Methods index​

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

Constructors​

Constructor​

new IconNavigationPolicy(): IconNavigationPolicy;

Returns​

IconNavigationPolicy

Methods​

getFirstChild()​

getFirstChild(_current): IFocusableNode | null;

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

Returns the first child of the given icon.

Parameters​

ParameterTypeDescription
_currentIconThe icon to return the first child of.

Returns​

IFocusableNode | null

Null.

Implementation of​

INavigationPolicy.getFirstChild


getParent()​

getParent(current): IFocusableNode | null;

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/icon_navigation_policy.ts:33

Returns the parent of the given icon.

Parameters​

ParameterTypeDescription
currentIconThe icon to return the parent of.

Returns​

IFocusableNode | null

The source block of the given icon.

Implementation of​

INavigationPolicy.getParent


getNextSibling()​

getNextSibling(current): IFocusableNode | null;

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/icon_navigation_policy.ts:43

Returns the next peer node of the given icon.

Parameters​

ParameterTypeDescription
currentIconThe icon to find the following element of.

Returns​

IFocusableNode | null

The next icon, field or input following this icon, if any.

Implementation of​

INavigationPolicy.getNextSibling


getPreviousSibling()​

getPreviousSibling(current): IFocusableNode | null;

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/icon_navigation_policy.ts:53

Returns the previous peer node of the given icon.

Parameters​

ParameterTypeDescription
currentIconThe icon to find the preceding element of.

Returns​

IFocusableNode | null

The icon's previous icon, if any.

Implementation of​

INavigationPolicy.getPreviousSibling


getRowId()​

getRowId(current): string;

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/icon_navigation_policy.ts:63

Returns the row ID of the given icon.

Parameters​

ParameterTypeDescription
currentIconThe icon to retrieve the row ID of.

Returns​

string

The row ID of the given icon.

Implementation of​

INavigationPolicy.getRowId


isNavigable()​

isNavigable(current): boolean;

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/icon_navigation_policy.ts:73

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

Parameters​

ParameterTypeDescription
currentIconThe instance to check for navigability.

Returns​

boolean

True if the given icon can be focused.

Implementation of​

INavigationPolicy.isNavigable


isApplicable()​

isApplicable(current): current is Icon;

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/icon_navigation_policy.ts:83

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 Icon

True if the object is an Icon.

Implementation of​

INavigationPolicy.isApplicable