createAnchorFromSelection
Anchors a popover at the caret — used by a command invoked from the keyboard, with the cursor already at the place being edited.
Import:
import { createAnchorFromSelection } from 'obsidian-dev-utils/obsidian/popovers/popover-anchor';Signature:
function createAnchorFromSelection(doc: Document): PopoverAnchorParameters:
| Parameter | Type | Description |
|---|---|---|
doc | Document | The document holding the selection. |
Returns: PopoverAnchor — The anchor, or a centered one when there is no caret to read.