.claude/skills/pinchtab-react-click-fix/SKILL.md
Fix Pinchtab/headless browser JavaScript .click() not triggering React event handlers. Use when: (1) pinchtab eval element.click() runs but React app doesn't respond, (2) clicking links/buttons on React SPAs via headless browser automation has no effect, (3) OpenTable or other React sites ignore programmatic clicks but work with real user clicks. Solution: use dispatchEvent with full MouseEvent sequence (mousedown/mouseup/click) with real coordinates from getBoundingClientRect().
npx skillsauth add Dbochman/dotfiles pinchtab-react-click-fixInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
When automating React-based websites with Pinchtab (or any headless browser tool that uses
element.click() via JavaScript eval), React's synthetic event system may not process the
click. The element's native click fires but React's event delegation doesn't pick it up,
so no navigation or state change occurs.
pinchtab eval "element.click()" runs successfully (no error) but nothing happenspinchtab snap -i -c may not show the target elements in the accessibility tree
(e.g., <a href="" role="button"> elements with empty href)Replace element.click() with a full MouseEvent dispatch sequence using real coordinates:
const rect = element.getBoundingClientRect();
const x = rect.x + rect.width / 2;
const y = rect.y + rect.height / 2;
const opts = { bubbles: true, cancelable: true, clientX: x, clientY: y, button: 0 };
element.dispatchEvent(new MouseEvent('mousedown', opts));
element.dispatchEvent(new MouseEvent('mouseup', opts));
element.dispatchEvent(new MouseEvent('click', opts));
Key requirements:
clientX/clientY from getBoundingClientRect() (React uses these for event delegation)bubbles: true: Events must bubble up to React's root event listenerReact uses event delegation — it attaches a single event listener at the root DOM node and
dispatches synthetic events based on the event target and coordinates. A simple .click()
call creates a click event but may not include the coordinates or preceding mousedown/mouseup
events that React's event system expects.
After dispatching, check that the page navigated or state changed:
// Wait a few seconds, then check
const url = window.location.href;
const title = document.title;
From the OpenTable booking script (opentable-book.sh):
// Find the best timeslot
const els = Array.from(document.querySelectorAll('a[role=button]'));
const timeEls = els.filter(e => /\d:\d\d [AP]M/.test(e.textContent.trim()));
// ... find closest to target time ...
// Click with full MouseEvent sequence
const rect = best.getBoundingClientRect();
const x = rect.x + rect.width/2;
const y = rect.y + rect.height/2;
const opts = {bubbles:true, cancelable:true, clientX:x, clientY:y, button:0};
best.dispatchEvent(new MouseEvent('mousedown', opts));
best.dispatchEvent(new MouseEvent('mouseup', opts));
best.dispatchEvent(new MouseEvent('click', opts));
click <ref> command should work correctly (it dispatches real
CDP input events), but some elements don't appear in pinchtab's accessibility tree snapshot
(e.g., <a href="" role="button"> with empty href), making native click unusablepinchtab click <ref> when the element IS in the snap tree.click() usually works finetools
Use exact configured Reolink cameras through the local Home Hub for availability and power status, fresh stills, visual commentary, protected Dylan/Julia/household sharing, and reversible spotlight control. Supports trusted owner tasks and explicitly scoped proactive automations; not for Nest or Ring cameras, arbitrary recipients, recordings, account changes, or raw camera APIs.
data-ai
Privately manage Dylan and Julia's household plant inventory and care history by physical location, bed, and exact Flower Cam view. Use for confirmed plant onboarding from camera conversations, camera- or bed-filtered inventory, record corrections, individual or whole-bed care, and private filtered exports. Pair with reolink-camera when an owner asks about plants visible in Flower Cam images.
testing
Inspect and control the physically secured Reachy Mini at Crosstown through ClawBody. Use for requests to check Reachy, look around, express an emotion, play any official emotion or dance preset, speak proactively, mute or unmute its microphone, stop movement, or describe what its camera sees.
tools
Handle Reachy/iMessage handoffs, selective durable memory, forgetting, and diagnostics; automatic context comes from the gateway plugin.