Implemented using WAI Guidelines.
Implemented using WAI Guidelines.
first
Type: array
Default: ["Home"]
Array with all values of event.key
, that set focus to the first element.
last
Type: array
Default: ["End"]
Array with all values of event.key
, that set focus to the last element.
next
Type: array
Default: ["ArrowRight", "ArrowDown"]
Array with all values of event.key
, that set focus to the next element. If wrap
is set to true
, then last element's next element is the first element.
previous
Type: array
Default: ["ArrowLeft", "ArrowUp"]
Array with all values of event.key
, that set focus to the previous element. If wrap
is set to true
, then first element's previous element is the last element.
character
Type: boolean
Default: true
Indicates if typing a character should move focus to the first item beginning with that character. If no item matches typed character, focus does not move.
wrap
Type: boolean
Default: true
If set to true indicates, first item's previous item is last item and last item's next item is first item.
childrenSelector
Type: string
Default: ':scope > *'
Informs the widget which elements it should iterate over. Allows to ignore wrapping elements, icons and so on.
findActive
Type: function
Default: (item) => item.getAttribute('tabindex') === '0'
Function used to identify active child on first interaction.
destroy
Removes all event listeners.
rovingtabindexinitialized
Fired when widget gets initialized.
rovingtabindexdestroyed
Fired after completing destroy action.
movefocus
Fired after pressing key should move focus. event.details
contains two fields (from
to) indicating previously focused item and item, that should get focused.
You will find all the code on Github.