Skip to content

createAnchorFromElement

Anchors a popover just below an element — used for a clicked element, whose rect is exactly where the user is looking.

Import:

import { createAnchorFromElement } from 'obsidian-dev-utils/obsidian/popovers/popover-anchor';

Signature:

function createAnchorFromElement(element: HTMLElement): PopoverAnchor

Parameters:

ParameterTypeDescription
elementHTMLElementThe element to anchor at.

Returns: PopoverAnchor — The anchor.