@oslokommune/punkt-elements
Version:
Komponentbiblioteket til Punkt, et designsystem laget av Oslo Origo
13 lines (12 loc) • 610 B
TypeScript
/**
* Build a list of focusable elements inside a container (same selector used by
* Lit and React fileupload preview modals). Hidden elements are filtered out.
*/
export declare function getFocusableElements(container: HTMLElement | null | undefined): HTMLElement[];
/**
* Keyboard handler that wraps Tab / Shift-Tab focus around the first and last
* focusable elements inside a container. Returns `true` if the event was handled.
*
* Call from a `keydown` listener on the modal root.
*/
export declare function trapTabInside(event: KeyboardEvent, container: HTMLElement | null | undefined): boolean;