Add AutomationPeer to Windows Borders for keyboard navigation and accessibility #32068
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.
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
This PR enables keyboard navigation and screen reader support for
Bordercontrols on Windows by implementing a customAutomationPeer, bringing Windows behavior in line with Mac Catalyst.Currently, on Mac Catalyst, borders with
SemanticProperties.Descriptioncan be navigated via keyboard and read by screen readers. On Windows, these borders are not recognized as focusable elements, preventing keyboard users from accessing them. This PR fixes that gap.Changes
New file:
ContentPanelAutomationPeer.cs- Custom automation peer forContentPanel(the platform view used byBorderHandleron Windows)Modified files:
ContentPanel.cs- Added automation peer support and dynamic focusability based on semantic propertiesViewExtensions.cs- ExtendedUpdateSemantics()to update focusability forContentPanelBorderHandlerTests.Windows.cs- Added tests for automation peer and focusability behaviorImplementation Details
The implementation follows the same pattern as
MauiButtonAutomationPeer:Grouptype for accessibility toolsIsTabStop = true) only whenSemanticProperties.Descriptionis setExample Usage
With this PR, Windows users can now:
Testing
Added unit tests to verify:
ContentPanelAutomationPeeris correctly createdReference
Implementation approach was informed by PR #27713, but this implementation takes a more focused approach by:
MauiButtonAutomationPeerpatternFixes #25712
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
scanning-api.github.com/home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Fixes #27627
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.