Stop finger taps from arriving as right clicks - #40
Merged
Merged
Conversation
buttonMaskRequired is only evaluated for indirect input devices. A direct touch carries no buttons, so it satisfied both the primary and the secondary tap recognizer; UIKit let only one of them recognize, and the secondary one won. Every tap reached the host as a right click. This was always the case — it only became visible once presses were held long enough for the host to see them at all. Restricting the secondary recognizer to indirect pointer input leaves finger taps to the primary one, while a trackpad or mouse right click still routes correctly. Also bumps the marketing version for the next release. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XU7Ck7AbZ9KpRhdPbRzNj8
7 tasks
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.
Summary
buttonMaskRequiredis only evaluated for indirect input devices. A direct touch carries no buttons, so a finger tap satisfied both the primary and the secondary tap recognizer. UIKit lets only one of them recognize, and the secondary one — added last — won, so every tap reached the host as a right click..indirectPointerleaves finger taps to the primary recognizer, while trackpad and mouse right clicks still route correctly. Apple Pencil taps now land as left clicks too.MARKETING_VERSIONto 1.0.5 for the next release.Verification
The regression test asserts the touch-type restriction. I confirmed it genuinely catches the bug by removing the fix and re-running — it fails with:
[0, 1, 2, 3]is every touch type including.direct(0), which is the bug stated precisely: the secondary recognizer was accepting finger taps.Test plan
test_secondaryTapIgnoresDirectTouches🤖 Generated with Claude Code