Sign up (with export icon)

DomOptimalPositionOptions

Api-interface icon interface

The getOptimalPosition() helper options.

Properties

  • Chevron-right icon

    element : HTMLElement
    readonly

    Element that is to be positioned.

  • Chevron-right icon

    fitInViewport : boolean | undefined
    readonly

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

  • Chevron-right icon

    limiter : null | RectSource | () => ( RectSource | null ) | undefined
    readonly

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

  • Chevron-right icon

    positions : readonly Array<PositioningFunction>
    readonly

    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.

  • Chevron-right icon

    target : RectSource | () => RectSource
    readonly

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

  • Chevron-right icon

    viewportOffsetConfig : object | undefined
    readonly

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

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