method
bun.WebView.click
x: number,
y: number,
): Promise<void>;
Click at the given viewport coordinates.
Fires native pointerdown/mousedown/pointerup/mouseup/click events with isTrusted: true. The promise resolves after WebContent has processed the full event sequence (including all JS handlers) — no polling, WebKit's own mouse-queue-drain barrier.
selector: string,
): Promise<void>;
Wait for an element to become actionable, then click its center.
Actionability is checked page-side at rAF rate: the element must be attached, have non-zero size, be in the viewport, be stable (bounding box unchanged for 2 consecutive frames), and be the topmost element at its center point (not obscured). Once actionable, a native click fires at the center coordinates.
// Waits for the button to appear and stop animating, then clicks.
await view.click("#submit");