KEMBAR78
[Android] TapGestureRecognizer cannot be tapped using Android Talkback in MAUI - fix by kubaflo · Pull Request #31486 · dotnet/maui · GitHub
Skip to content

Conversation

@kubaflo
Copy link
Contributor

@kubaflo kubaflo commented Sep 4, 2025

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description of Change

Setting platformView.Clickable = true caused TalkBack to send an accessibility ACTION_CLICK instead of synthesizing the underlying MotionEvents. MAUI’s gesture pipeline (Tap / Pan / Pinch detectors) depends on raw MotionEvents; since no OnClick listener forwarded ACTION_CLICK to the gesture recognizers, the double‑tap activation never reached TapGestureRecognizer.

Issues Fixed

Fixes #31483

Eliminated handling of the Clickable property and its default value in GesturePlatformManager.Android.cs, as it is no required for gesture management.
@Copilot Copilot AI review requested due to automatic review settings September 4, 2025 18:22
@kubaflo kubaflo requested a review from a team as a code owner September 4, 2025 18:22
Copy link
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 fixes an accessibility issue on Android where TapGestureRecognizer cannot be activated using Android TalkBack's double-tap gesture. The fix removes the forced setting of the Clickable property to true on platform views, which was causing TalkBack to send accessibility actions instead of the raw motion events that MAUI's gesture pipeline requires.

  • Removes the _clickableDefaultValue field and its associated logic
  • Eliminates the forced setting of platformView.Clickable = true
  • Restores the cleanup logic that previously reset the clickable property

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Sep 4, 2025
@kubaflo kubaflo self-assigned this Sep 4, 2025
@kubaflo kubaflo added platform/android t/a11y Relates to accessibility labels Sep 4, 2025
@PureWeen PureWeen added this to the .NET 9 SR11 milestone Sep 4, 2025
@PureWeen
Copy link
Member

PureWeen commented Sep 4, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz jsuarezruiz added the area-gestures Gesture types label Sep 5, 2025
@github-project-automation github-project-automation bot moved this from Todo to Approved in MAUI SDK Ongoing Sep 5, 2025
@PureWeen PureWeen merged commit 78623d6 into dotnet:main Sep 5, 2025
129 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in MAUI SDK Ongoing Sep 5, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Oct 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-gestures Gesture types community ✨ Community Contribution platform/android t/a11y Relates to accessibility

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

TapGestureRecognizer cannot be tapped using Android Talkback in MAUI 9.0.100

3 participants