stax-monorepo
    Preparing search index...

    Interface KeyboardOptions

    Options for a keyboard binding.

    interface KeyboardOptions {
        preventDefault?: PreventDefaultRule;
        stopPropagation?: boolean;
        target?: HTMLElement | ElementRef<HTMLElement | SVGElement> | "document";
    }
    Index
    preventDefault?: PreventDefaultRule

    Whether to preventDefault a matched event.

    • true — always
    • false — never
    • predicate — evaluated per event
    • omitted — smart default that skips preventDefault when the event target is an editable element (input, textarea, contenteditable), so that global bindings like "j" for feed nav don't block typing in a search box. See outsideInputs.
    stopPropagation?: boolean

    Whether to stopPropagation a matched event. Defaults to false, so a parent scope's handler for the same binding also fires. Set true when a child should "consume" the key from the parent (e.g. Escape closes the child modal without also closing the parent).

    target?: HTMLElement | ElementRef<HTMLElement | SVGElement> | "document"

    Where to listen. Defaults to "document" — global.

    • "document" — global listener on document.
    • HTMLElement — bound to that specific element.
    • ElementRef — reactive; the listener is (re)attached when the ref's element mounts and detached when it unmounts, via the ref's isConnected Readable.