ink-cartridge
    Preparing search index...

    Type Alias ModalLayer

    State shape of a modal layer.

    Modal layers render above normal layers and take keyboard priority: only the modal layer with the highest z-index receives keyboard events.

    type ModalLayer = {
        automaticTakeoverKeyboard: boolean | ComponentType<any>[];
        createdAt: number;
        crossPage: boolean;
        elements: Map<string, LayerElement>;
        hostPage: React.ComponentType<any> | null;
        initialZIndex: number;
        layerId: string;
        regionFocus: RegionFocusMap;
        zIndex: number;
    }
    Index
    automaticTakeoverKeyboard: boolean | ComponentType<any>[]

    Whether the modal layer automatically takes over keyboard events, and the scope of that takeover.

    • false (default): no takeover — the bindings stay active on every page.
    • true: the bindings are active only while the modal layer's host page is the current page; navigating away pops the keyboard owner and returning to the host page pushes it again.
    • ComponentType<any>[]: scopes the takeover to the listed pages. While the current page is one of them, the keyboard owner is popped and the bindings go dormant; on any other page they stay active.

    Typically used together with crossPage so a persistent modal layer does not intercept keys on other pages.

    createdAt: number

    When the z-index values are equal, this field is used to determine the stacking order.

    crossPage: boolean

    Normally, when the application executes page-switching methods such as skip or gotoScreen, the layer is automatically cleared; a toggle is provided here to prevent this automatic clearing.

    elements: Map<string, LayerElement>

    Elements included in this layer

    hostPage: React.ComponentType<any> | null

    The screen that was current in the navigation path when the modal layer opened. With automaticTakeoverKeyboard: true, the bindings stay dormant while this page is not the current one; an array scopes the takeover by listed pages instead.

    initialZIndex: number

    The zIndex the modal layer was opened with. Kept for symmetry with Layer.initialZIndex — modal layers are not raised by BringLayerToFrontFn, so the two stay equal.

    layerId: string

    The ID of the modal layer must be unique

    regionFocus: RegionFocusMap

    Map of mouse-region refs inside this modal layer to the keyboard focus each drives. Persisted on the modal layer object so it survives re-renders of CurrentScreen.

    zIndex: number

    The priority of the modal layer. The priority of the modal layer is greater than that of the normal layer. The greater the zIndex of the modal layer, the higher the keyboard priority, and the higher the visual effect. Only the modal layer with the highest zIndex will receive keyboard events.