Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Popup: Android screen reader accessibility - #2959

#2959
Merged
TheCodeTraveler merged 5 commits into
CommunityToolkit:mainCommunityToolkit/Maui:mainfrom
IeuanWalker:PopupAccessibilityIeuanWalker/Maui:PopupAccessibilityCopy head branch name to clipboard
May 26, 2026
Merged

Popup: Android screen reader accessibility#2959
TheCodeTraveler merged 5 commits into
CommunityToolkit:mainCommunityToolkit/Maui:mainfrom
IeuanWalker:PopupAccessibilityIeuanWalker/Maui:PopupAccessibilityCopy head branch name to clipboard

Conversation

@IeuanWalker

Copy link
Copy Markdown
Contributor

Description of Change

Fix Android screen reader accessibility

As you can see from the before video, the non-interactive elements (labels) arnt focusable to the screenreader. And the popup view itself is.

Before After
android-before.mp4
android-after.mp4

I've tested iOS and it is unchanged from before, and behaves the same as the after video on Android.

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

Ieuan Walker and others added 3 commits November 21, 2025 17:21
Removed the `TapGestureRecognizer` from the `PopupPage` constructor to simplify tap handling logic. Updated `PopupPageLayout` to enhance accessibility by excluding the overlay `Grid` and `PopupBorder` from the accessibility tree, ensuring only relevant popup content is accessible to assistive technologies.
Refactored the `VerticalStackLayout.Resources` section in
`ButtonPopup.xaml` for better readability and consistency.

Added a `Loaded` event handler (`Label_Loaded`) to the `Label`
with the `Title` style to set semantic focus on load, enhancing
accessibility. Implemented the `Label_Loaded` method in
`ButtonPopup.xaml.cs` to handle this functionality.
Removed comments explaining the accessibility setup for the
overlay Grid and PopupBorder. No functional changes were
made to the accessibility behavior, as the relevant
`AutomationProperties.SetIsInAccessibleTree` calls remain
unchanged. The comments were likely removed for clarity or
to reduce redundancy.
Copilot AI review requested due to automatic review settings November 22, 2025 19:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 Android screen reader accessibility for the Popup component by ensuring that non-interactive container elements are excluded from the accessibility tree, allowing screen readers to properly focus on interactive and content elements within the popup.

Key Changes:

  • Set IsInAccessibleTree to false for popup container elements (PopupPageLayout and PopupBorder) to improve screen reader navigation
  • Added semantic focus to the first label in the ButtonPopup sample to demonstrate proper accessibility behavior
  • Applied formatting improvements to the ButtonPopup.xaml sample

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/CommunityToolkit.Maui/Views/Popup/PopupPage.shared.cs Excludes popup container elements from accessibility tree to fix Android screen reader focus issues
samples/CommunityToolkit.Maui.Sample/Views/Popups/ButtonPopup.xaml.cs Adds event handler to set semantic focus on the title label when loaded
samples/CommunityToolkit.Maui.Sample/Views/Popups/ButtonPopup.xaml Wires up Loaded event and applies formatting improvements (tabs to spaces)

Update Label_Loaded method with nullability and logic

The `Label_Loaded` method in `ButtonPopup.xaml.cs` was updated to
accept a nullable `sender` parameter by changing its signature
to `void Label_Loaded(object? sender, EventArgs e)`.

Additionally, the method implementation was added to check if
the `sender` is of type `Label`. If so, it casts the `sender`
to a `Label` and calls the `SetSemanticFocus` method on it.
@IeuanWalker

Copy link
Copy Markdown
Contributor Author

This is the website is use to validate accessibility behaviour, as you can see this PR matches what is expected - https://www.magentaa11y.com/#/native-criteria/notifications/modal?tab=4

@IeuanWalker

IeuanWalker commented Dec 19, 2025

Copy link
Copy Markdown
Contributor Author

@TheCodeTraveler @jfversluis hoping someone can take a look at this. Plan to migrate from Mopups to the toolkit but accessibility is a legal requirement for us.

@VladislavAntonyuk
VladislavAntonyuk enabled auto-merge (squash) January 10, 2026 08:34
@bijington

Copy link
Copy Markdown
Contributor

@IeuanWalker thanks for this! Sorry it's taken so long for someone to look at it

@IeuanWalker

Copy link
Copy Markdown
Contributor Author

@bijington no prob, thanks for taking a look :)

@bijington

Copy link
Copy Markdown
Contributor

@bijington no prob, thanks for taking a look :)

You're UK based right? It's a distance from Wales but will you be coming to MAUI Day next month in London?

@IeuanWalker

IeuanWalker commented Jan 11, 2026

Copy link
Copy Markdown
Contributor Author

@bijington ye based in Cardiff. I want too, messaged my manager about it few days ago, not heard back yet :/ will chase him tomorrow lol

Just hope there are tickets left 🤞

@bijington

Copy link
Copy Markdown
Contributor

@bijington ye based in Cardiff. I want too, messaged my manager about it few days ago, not heard back yet :/ will chase him tomorrow lol

Just hope there are tickets left 🤞

If you get approval and there are no tickets let me know 👍

@IeuanWalker

Copy link
Copy Markdown
Contributor Author

@bijington got approval and a ticket 👌

Do you know what time it starts/ opens and when it ends? Need to look at booking a train for it

@bijington

Copy link
Copy Markdown
Contributor

@bijington got approval and a ticket 👌

Do you know what time it starts/ opens and when it ends? Need to look at booking a train for it

Amazing news! I believe we had the venue from 08:30 but talks will only start from 09:00-09:15. And I think we have to be out by 17:30 at the latest. We will be heading to a place for a drink after if you need to kill time for the next train 👍

Also if it's easier feel free to reach out via Discord (my username is the same) and I will probably be more responsive

@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 Feb 16, 2026
@WilliamWatterson86

Copy link
Copy Markdown

Any news on this one - will it be merged in soon?

@TheCodeTraveler TheCodeTraveler self-assigned this May 7, 2026
@TheCodeTraveler TheCodeTraveler removed help wanted This proposal has been approved and is ready to be implemented stale The author has not responded in over 30 days labels May 7, 2026
auto-merge was automatically disabled May 26, 2026 15:58

Head branch was pushed to by a user without write access

@IeuanWalker

Copy link
Copy Markdown
Contributor Author

@TheCodeTraveler fixed the merge conflict

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Children.Add(TapGestureGestureOverlay);
Children.Add(PopupBorder);

AutomationProperties.SetIsInAccessibleTree(this, false);
Comment on lines +255 to +256
AutomationProperties.SetIsInAccessibleTree(this, false);
AutomationProperties.SetIsInAccessibleTree(PopupBorder, false);
Comment on lines 10 to 13
void Button_Clicked(object? sender, EventArgs e)
{
CloseAsync();
}
<Button
<Label Style="{StaticResource Title}" Text="Button Popup" Loaded="Label_Loaded" />
<BoxView Style="{StaticResource Divider}" />
<Label Style="{StaticResource Content}" Text="This is a platform specific popup with a .NET MAUI View being rendered. The behaviors of the popup will confirm to 100% this platform look and feel, but still allows you to use your .NET MAUI controls." />

@TheCodeTraveler TheCodeTraveler left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @IeuanWalker!!

@TheCodeTraveler
TheCodeTraveler merged commit 010039b into CommunityToolkit:main May 26, 2026
9 of 10 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Popup: Android screen reader accessibility

6 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.