Dockview
    Preparing search index...

    Interface DismissableLayerOptions

    interface DismissableLayerOptions {
        capture?: boolean;
        elements?: () => HTMLElement[];
        escape?: boolean;
        focusOut?: boolean;
        isFocusInside?: (focused: Element) => boolean;
        isInside?: (event: PointerEvent) => boolean;
        keys?: readonly string[];
        now?: () => number;
        onDismiss: () => void;
        onInsidePointerDown?: (event: PointerEvent) => void;
        outsidePointerDown?: boolean;
        pointerDownGraceMs?: number;
        resize?: boolean;
        window?: Window;
    }
    Index

    Properties

    capture?: boolean

    Listen in the capture phase (default false). Use capture when the layer must see the event before content handlers stop its propagation.

    elements?: () => HTMLElement[]

    Elements treated as "inside" by the default contains check.

    escape?: boolean

    Dismiss on Escape (default true).

    focusOut?: boolean

    Dismiss when focus moves to an element outside the layer (default false): the "slide back on focus loss" behaviour.

    isFocusInside?: (focused: Element) => boolean

    Whether a newly-focused element is inside the layer (for focusOut). Defaults to a contains check against elements. Provide this for geometry-based testing when the content is a sibling overlay stacked on top of the layer.

    isInside?: (event: PointerEvent) => boolean

    Whether a pointer event is inside the layer. Defaults to a DOM contains check against DismissableLayerOptions.elements. Provide this for geometry-based hit testing (e.g. when the visible content is a sibling overlay stacked on top of the layer).

    keys?: readonly string[]

    Extra keys that also dismiss (e.g. 'Enter').

    now?: () => number

    Clock source for the grace window. Defaults to Date.now.

    onDismiss: () => void

    Invoked when any enabled dismiss signal fires.

    onInsidePointerDown?: (event: PointerEvent) => void

    A pointerdown landed inside the layer (not a dismissal). Use it to mark interaction (e.g. make a transient layer sticky).

    outsidePointerDown?: boolean

    Dismiss on a pointerdown outside the layer (default true).

    pointerDownGraceMs?: number

    Ignore outside-pointerdowns for this many ms after opening. Covers the gesture that opened the layer (e.g. a touch long-press) dispatching a follow-up pointerdown just outside it.

    resize?: boolean

    Dismiss on window resize, skipping touch-driven resizes (default false).

    window?: Window

    Window to listen on. Pass the popout window for popout-hosted layers. Defaults to the global window.