Navigator
A helper class which allows keyboard navigation within the target element.
Configs
14
Configs
14Configure as true to activate items on mouseover. This is used by the Combo
field when using a List as its dropdown.
The currently focused element within the target.
Configure as true to also navigate when the CTRL modifier key is used along with
navigation keys.
Configure as true to also navigate when the SHIFT modifier key is used along with
navigation keys.
The number of columns if the navigable items are in a flexbox or grid layout.
This is used to determine the action taken when using UP and DOWN arrow keys.
This is calculated automatically from the grid-template-columns style of the item container if possible.
If using a flexbox layout, and there is a regular number of columns on every row, specify the number of columns
there will be in each row.
Configure as, or set to true to disable the processing of keys.
A CSS class name to add to focused elements.
A query selector which identifies descendant elements within the target which are navigable.
If the items in the owning widget are naturally tabbable, then the Navigator does not need to listen for navigation keys and move focus. It just reacts to natural focus movement.
The element which provides key events for navigation. Optional. Defaults to the target element.
An object containing key definitions keyed by the key name eg:
keys : {
"CTRL+Space" : 'onCtrlSpace',
Enter : 'onEnterKey'
}
The ownerCmp is used as the this reference and to resolve string method names.
The following arguments are passed to the handling method:
- keyEvent : The key event.
- navigator : This Navigator instance.
- activeItem : The currently focused element.
Modified key names must be created prepending one or more 'CTRL+', 'SHIFT+', 'ALT+'
in that order, for example "CTRL+SHIFT+Enter" : 'showMenu'
An optional key event processor which may preprocess the key event. Returning null prevents processing of the event.
| Parameter | Type | Description |
|---|---|---|
event | KeyboardEvent |
The encapsulating element in which navigation takes place.
Functions
1
Functions
1Returns the next or previous navigable element starting from the passed from element,
navigating in the passed direction.
| Parameter | Type | Description |
|---|---|---|
from | HTMLElement | The start point. Defaults to the current activeItem |
direction | Number | The direction. -1 for backwards, else forwards. |