UseListboxNavReturn
Defined in: src/hooks/useListboxNav/useListboxNav.ts:42
Properties
Section titled “Properties”activeIndex
Section titled “activeIndex”activeIndex:
number
Defined in: src/hooks/useListboxNav/useListboxNav.ts:44
Currently active index, or -1 when none.
first: () =>
void
Defined in: src/hooks/useListboxNav/useListboxNav.ts:52
Activate the first non-disabled item.
Returns
Section titled “Returns”void
handleKeyDown
Section titled “handleKeyDown”handleKeyDown: (
event) =>boolean
Defined in: src/hooks/useListboxNav/useListboxNav.ts:61
Single keyboard handler for ArrowUp/Down/Home/End/Enter/Escape. Returns
true when the event was handled (and preventDefault was called).
Parameters
Section titled “Parameters”KeyboardEvent | KeyboardEvent<Element>
Returns
Section titled “Returns”boolean
last: () =>
void
Defined in: src/hooks/useListboxNav/useListboxNav.ts:54
Activate the last non-disabled item.
Returns
Section titled “Returns”void
navigableIndices
Section titled “navigableIndices”navigableIndices:
number[]
Defined in: src/hooks/useListboxNav/useListboxNav.ts:63
Snapshot of the navigable indices (non-disabled, in order).
next: () =>
void
Defined in: src/hooks/useListboxNav/useListboxNav.ts:48
Move to the next non-disabled item.
Returns
Section titled “Returns”void
prev: () =>
void
Defined in: src/hooks/useListboxNav/useListboxNav.ts:50
Move to the previous non-disabled item.
Returns
Section titled “Returns”void
selectActive
Section titled “selectActive”selectActive: () =>
void
Defined in: src/hooks/useListboxNav/useListboxNav.ts:56
Commit the active item via onSelect.
Returns
Section titled “Returns”void
setActiveIndex
Section titled “setActiveIndex”setActiveIndex: (
index) =>void
Defined in: src/hooks/useListboxNav/useListboxNav.ts:46
Direct setter; the value is not validated.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void