Skip to content

hoverElement

Moves the pointer to the center of an element using trusted pointer input, then polls until the element actually matches :hover.

Desktop only — it throws on mobile, where :hover has no touch equivalent.

Import:

import { hoverElement } from '@mnaoumov/obsidian-lib/trusted-input';

Signature:

function hoverElement(params: HoverElementParams): Promise<void>

Parameters:

Parameter Type Description
params HoverElementParams The element to hover.

Returns: Promise<void> — A Promise that resolves once the element matches :hover.


Links to this page: