Trilium Frontend API
    Preparing search index...

    Interface DomOptimalPositionOptions

    The getOptimalPosition() helper options.

    interface DomOptimalPositionOptions {
        element: HTMLElement;
        fitInViewport?: boolean;
        limiter?: RectSource | (() => RectSource);
        positions: readonly PositioningFunction[];
        target: RectSource | (() => RectSource);
        viewportOffsetConfig?: {
            bottom?: number;
            left?: number;
            right?: number;
            top?: number;
        };
    }
    Index

    Properties

    element: HTMLElement

    Element that is to be positioned.

    fitInViewport?: boolean

    When set, the algorithm will chose such a position which fits element the most inside visible viewport.

    limiter?: RectSource | (() => RectSource)

    When set, the algorithm will chose position which fits the most in the limiter's bounding rect.

    positions: readonly PositioningFunction[]

    An array of positioning functions.

    Note: Positioning functions are processed in the order of preference. The first function that works in the current environment (e.g. offers the complete fit in the viewport geometry) will be picked by getOptimalPosition().

    Note: Any positioning function returning null is ignored.

    target: RectSource | (() => RectSource)

    Target with respect to which the element is to be positioned.

    viewportOffsetConfig?: {
        bottom?: number;
        left?: number;
        right?: number;
        top?: number;
    }

    Viewport offset config object. It restricts the visible viewport available to the getOptimalPosition() from each side.

    {
    top: 50,
    right: 50,
    bottom: 50,
    left: 50
    }