Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly implement the UIGestureRecognizer state machine #2004

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

filipnavara
Copy link
Contributor

Description of Change

Apple has an extensive documentation on implementing custom gesture recognizers. For discrete gesture recognizers, like the one implemented in TouchBehavior, you are supposed to communicate the state back as Possible / Failure / Recognized. This affects interaction with other gesture recognizers.

Previously the State was never set and left at the default Possible value (initial value and default after Reset). This causes simultaneous gesture recognizers on parent views to fire even if TouchBehavior recognized the gesture.

As a side effect of fixing the state machine, we no longer need to manually prevent simultaneous touches with ShouldReceiveTouch behavior override and we can revert ShouldRecognizeSimultaneously to its default behavior of returning false.

Linked Issues

PR Checklist

  • Has a linked Issue, and the Issue has been approved(bug) or Championed (feature/proposal)
  • Has tests (if omitted, state reason in description)
  • Has samples (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Changes adhere to coding standard
  • Documentation created or updated: https://github.com/MicrosoftDocs/CommunityToolkit/pulls

Additional information

@dotnet-policy-service dotnet-policy-service bot added stale The author has not responded in over 30 days help wanted This proposal has been approved and is ready to be implemented labels Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted This proposal has been approved and is ready to be implemented stale The author has not responded in over 30 days
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants