Skip to content

hoverElement

Always throws: :hover has no touch equivalent.

A silent no-op here would let a hover test pass on a phone without hovering anything, so the mobile arm refuses instead. Gate the assertion on Platform.isDesktopApp, or drive the element with clickElement.

Import:

import { hoverElement } from 'obsidian-dev-utils/obsidian/mobile-trusted-input';

Signature:

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

Parameters:

ParameterTypeDescription
paramsHoverElementParamsThe element to hover.

Returns: Promise<void> — A Promise that never resolves — the call throws.


Links to this page: