LWT JavaScript API
    Preparing search index...
    • Choose the half of the viewport that keeps the anchor word visible.

      Falls back to 'bottom' — the pre-existing behaviour — whenever there is no usable anchor, so a missing element never makes placement worse than before.

      Parameters

      • anchor: HTMLElement | null

        The word element the modal was opened for

      Returns ModalPlacement

      'top' when the word sits in the lower half, otherwise 'bottom'