Skip to content

Handle lostpointercapture as well#8696

Merged
slimbuck merged 1 commit into
playcanvas:mainfrom
slimbuck:pointer-dev
May 7, 2026
Merged

Handle lostpointercapture as well#8696
slimbuck merged 1 commit into
playcanvas:mainfrom
slimbuck:pointer-dev

Conversation

@slimbuck
Copy link
Copy Markdown
Member

@slimbuck slimbuck commented May 7, 2026

Otherwise pointer up events go missing when focus is on an iframe parent.

@slimbuck slimbuck requested a review from Copilot May 7, 2026 11:55
@slimbuck slimbuck self-assigned this May 7, 2026
@slimbuck slimbuck added the area: input Input related issue label May 7, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the KeyboardMouseSource input handling to also treat lostpointercapture as a “pointer up”-equivalent, preventing stuck/missing mouse button state when pointer capture is lost (e.g., due to focus changes involving an iframe parent).

Changes:

  • Add a lostpointercapture event listener that routes into the existing _onPointerUp cleanup logic.
  • Ensure the listener is correctly removed on detach() to avoid leaks / duplicate handlers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@slimbuck slimbuck merged commit 530d804 into playcanvas:main May 7, 2026
10 of 12 checks passed
@slimbuck slimbuck deleted the pointer-dev branch May 7, 2026 11:58
@slimbuck slimbuck requested a review from a team May 7, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: input Input related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants