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 'obsidian-dev-utils/obsidian/popovers/popover-anchor';Signature:
function createAnchorFromPoint(x: number, y: number, doc: Document): PopoverAnchorParameters:
| 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.