UI Headless Runtime API - v1.0.0
    Preparing search index...

    Interface ListboxController

    Headless Listbox controller using active-descendant focus.

    interface ListboxController {
        destroy(): void;
        getSnapshot(): Readonly<TSnapshot>;
        handleKeyDown(event: KeyboardEvent): void;
        off<TKey extends keyof ListboxEvents>(
            type: TKey,
            listener: RuntimeEventListener<ListboxEvents[TKey]>,
        ): void;
        on<TKey extends keyof ListboxEvents>(
            type: TKey,
            listener: RuntimeEventListener<ListboxEvents[TKey]>,
        ): Unsubscribe;
        once<TKey extends keyof ListboxEvents>(
            type: TKey,
            listener: RuntimeEventListener<ListboxEvents[TKey]>,
        ): Unsubscribe;
        registerOption(option: ListboxOption): () => void;
        select(id: string, details?: ChangeDetails<ListboxChangeReason>): void;
        setActive(id: string | null): void;
        subscribe(listener: SnapshotListener<ListboxSnapshot>): Unsubscribe;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Handles Arrow keys, Home/End, typeahead, Enter, and Space.

      Parameters

      • event: KeyboardEvent

      Returns void

    • Sets the keyboard-active enabled option.

      Parameters

      • id: string | null

      Returns void