Skip to content

Lib.hoverElement method

Lib › hoverElement

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

Because the move is trusted (see Lib.moveMouse), the real :hover state takes effect in the CSS engine — real theme var() values and real compositing — instead of a hand-simulated cascade. It polls the live element.matches(':hover') state (not a fixed delay), so it is robust under shared-instance load. It targets the single shared window's **global** pointer, so only one element is hovered at a time.

Signature:

hoverElement(this: void, params: HoverElementParams): Promise<void>

Parameters:

ParameterTypeDescription
thisvoid
paramsHoverElementParamsThe element to hover.

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