Skip to content

createAnchorFromPoint

Anchors a popover at a pointer position — used for a context menu, which is raised by a right-click or a long-press whose coordinates are where the user is looking.

Import:

import { createAnchorFromPoint } from '@mnaoumov/obsidian-lib/popovers/popover-anchor';

Signature:

function createAnchorFromPoint(x: number, y: number, doc: Document): PopoverAnchor

Parameters:

Parameter Type Description
x number The viewport x coordinate.
y number The viewport y coordinate.
doc Document The document the coordinates belong to.

Returns: PopoverAnchor — The anchor.