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 '@mnaoumov/obsidian-lib/desktop-trusted-input';

Signature:

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

Parameters:

Parameter Type Description
params UnhoverElementParams The 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: