Repository navigation
fix: Dispatch mouseup for presses released outside the target - #10129
Open
Harrison0223-svg wants to merge 1 commit into
Open
Harrison0223-svg wants to merge 1 commit into
Harrison0223-svg wants to merge 1 commit into
Conversation
Track presses dispatched by Mouse separately from the window-wide button state so releases can finish a drag without sending unrelated outside mouse events. Fixed playcanvas#9906
Author
|
Chrome 158 on Apple Silicon, automated verification by OpenAI Codex. At 9258d38, a trusted press inside the canvas and release outside produced exactly one mouseup at (−10, 90). The base lost the release. Entirely external clicks were filtered, and detaching and reattaching the target cleared the previous press. Actual pointer lock remains unverified. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Dragging outside the mouse target and releasing can leave drag listeners active: the window updates its button state, but the target-bounds filter suppresses its
mouseupevent. Track which button presses this Mouse actually delivered and forward the matching outside release with target-relative coordinates. Keep unrelated outside events filtered and preserve pointer-lock and blur behavior. This only handles releases delivered to the attached window.Fixes #9906
Verification: With only
mouse.jsstashed, the same mouse suites ran with 31 passing and 2 failing. Restoring the change gave 33 passing. Full suite: 4,974 passing and 44 pending. Lint and type checks passed locally. Physical browser drag and PR CI are not verified.Disclosure: AI-assisted implementation and testing. Human review is pending.
Checklist