[0.80-stable] Cherry-pick: Add UIA HeadingLevel behaviour for Fabric architecture #15221
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.
This PR cherry-picks commit 8826a55 from main to the 0.80-stable branch.
Summary
This change adds UI Automation (UIA) HeadingLevel support for the Fabric architecture in React Native Windows. This enables proper accessibility behavior for heading elements, allowing screen readers and other assistive technologies to correctly identify and navigate heading levels (H1-H9) in Fabric-based applications.
Changes
Core Implementation
GetHeadingLevel()
function inUiaHelpers.cpp
that maps accessibility levels (1-9) to UIA HeadingLevel constants when the element has a heading roleGetControlTypeFromRole()
andGetControlTypeFromString()
helper functions to properly map React Native roles to UIA control typesCompositionDynamicAutomationProvider.cpp
to query and expose the HeadingLevel property via IUIAutomationElement8Test Updates
role="heading"
andaccessibilityRole="header"
to demonstrate the feature50026
(group) to50020
(text) for heading elementsConflict Resolution
One merge conflict was resolved in
AccessibilityTest.test.ts.snap
where the 0.80-stable branch includes "Name" fields in test snapshots that aren't present in main. The resolution preserved the "Name" fields while accepting the LocalizedControlType changes from the cherry-picked commit.Testing
The changes include updated test snapshots that validate:
Fixes accessibility navigation and screen reader support for heading elements in Fabric architecture.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Microsoft Reviewers: Open in CodeFlow