Skip to content

[Android] [a11y] Support fot the button role to spans with GestureRecognizer#29307

Open
kubaflo wants to merge 2 commits intodotnet:mainfrom
kubaflo:25763
Open

[Android] [a11y] Support fot the button role to spans with GestureRecognizer#29307
kubaflo wants to merge 2 commits intodotnet:mainfrom
kubaflo:25763

Conversation

@kubaflo
Copy link
Contributor

@kubaflo kubaflo commented May 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!

Issues Fixed

Fixes #25763

Copilot AI review requested due to automatic review settings May 4, 2025 22:07
@kubaflo kubaflo requested a review from a team as a code owner May 4, 2025 22:07
@kubaflo kubaflo requested review from mattleibow and rmarinho May 4, 2025 22:07
@kubaflo kubaflo self-assigned this May 4, 2025
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label May 4, 2025
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 enhances accessibility support by adding logic to handle the button role for spans with a GestureRecognizer, ensuring that tap gestures with a single tap are correctly recognized.

  • Added iteration over CompositeGestureRecognizers to handle accessibility for tap gestures.
  • Returns a primary button check when an eligible GestureRecognizer is found.

}
}

foreach (var gesture in virtualView.GestureController.CompositeGestureRecognizers)
Copy link

Copilot AI May 4, 2025

Choose a reason for hiding this comment

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

The logic for determining the primary button is now duplicated in two separate code blocks. Consider refactoring the common check into a helper method to improve maintainability.

Copilot uses AI. Check for mistakes.
@kubaflo kubaflo added platform/android t/a11y Relates to accessibility area-gestures Gesture types and removed community ✨ Community Contribution labels May 4, 2025
@ChristopherStephan
Copy link

@mattleibow @rmarinho @kubaflo How to proceed here?

@github-actions
Copy link
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 29307

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 29307"

{
internal static bool HasAccessibleTapGesture(this View virtualView) =>
HasAccessibleTapGesture(virtualView, out _);
internal static bool ControlsAccessibilityDelegateNeeded(this View virtualView)
Copy link
Contributor

Choose a reason for hiding this comment

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

please fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-gestures Gesture types platform/android t/a11y Relates to accessibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Role "Button" not announced by TalkBack for Spans with GestureRecognizer

4 participants