Skip to content

unhoverElement

Moves the mouse pointer to a point just outside an element’s bounding box using a trusted Electron pointer move, then polls until the element no longer matches :hover.

The inverse of hoverElement. When an element spans the full viewport (no point outside its box is reachable), use moveMouse directly to move the pointer to a known empty coordinate instead.

Import:

import { unhoverElement } from 'obsidian-dev-utils/obsidian/desktop-trusted-input';

Signature:

function unhoverElement(params: UnhoverElementParams): Promise<void>

Parameters:

ParameterTypeDescription
paramsUnhoverElementParamsThe element to move the pointer away from.

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


Links to this page: