Skip to content

fix(locator): serialize mouse move/press/release CDP dispatch sequence (#2486) - #2852

Open
teddiesloco wants to merge 1 commit into
browserbase:mainfrom
teddiesloco:fix/locator-click-sequential-mouse-dispatch
Open

fix(locator): serialize mouse move/press/release CDP dispatch sequence (#2486)#2852
teddiesloco wants to merge 1 commit into
browserbase:mainfrom
teddiesloco:fix/locator-click-sequential-mouse-dispatch

Conversation

@teddiesloco

@teddiesloco teddiesloco commented Aug 29, 2026

Copy link
Copy Markdown

Summary

  • Fixes v4: locator.click() returns without committing a selectable row #2486 by ensuring CDP mouse events (mouseMoved, mousePressed, mouseReleased) in Understudy.Locator.click are dispatched sequentially instead of being pipelined via Promise.all.
  • Prevents race conditions where selectable component states (such as active hover/pointer states in React buttons/anchors) fail to commit before press/release.

Test Plan

  • Verified sequential CDP input dispatch order.
  • Verified cleanly formatted TS diff matching the repo's Understudy locator contract.

Summary by cubic

Fixes #2486 by serializing the CDP mouse event dispatch sequence in Locator.click. Previously, mouseMoved, mousePressed, and mouseReleased were fired concurrently via Promise.all, which could let press/release execute before the browser committed hover or pointer states, causing missed clicks on React buttons and anchors. The events now run sequentially in order, with press/release repeated per click count as before.

Written for commit a5fcf49. Summary will update on new commits.

Review in cubic

@changeset-bot

changeset-bot Bot commented Aug 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a5fcf49

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run.
Approving the latest commit mirrors it into an internal PR owned by the approver.
If new commits are pushed later, the internal PR stays open but is marked stale until someone approves the latest external commit and refreshes it.

@github-actions github-actions Bot added external-contributor Tracks PRs mirrored from external contributor forks. external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. labels Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. external-contributor Tracks PRs mirrored from external contributor forks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v4: locator.click() returns without committing a selectable row

1 participant