CngxAccordionKeyboardNav
projects/common/interactive/accordion/accordion-keyboard-nav.ts
Referenced by#
Import#
import { CngxAccordionKeyboardNav } from '@cngx/common/interactive'
Description#
Resolved keyboard surface for an accordion's headers. The panel binds
tabindex from headerTabindex and routes its (keydown) through
handleKeydown; a single header - the coordinator's rovingActiveId -
is the group's lone tab stop, so Tab always lands on it.
Index#
Methods
Methods#
handleKeydown(event: KeyboardEvent)WAI-ARIA accordion navigation: ArrowUp/ArrowDown move between headers in
DOM order (Home/End jump to the first/last), skipping disabled headers,
looping at the edges. Moves DOM focus to the target and records it via
host.setRovingActive(id). Returns silently for any other key so the
caller can chain further handlers.
KeyboardEvent"0" | unknownheaderTabindex(handle: CngxAccordionHeaderHandle)Roving tabindex for a header: 0 for the header whose id matches the
coordinator's rovingActiveId, -1 for every other. Derived from a
single source (Pillar 1 - never a second index to keep in sync).