Add support for UIA accessibility headings #8516
Merged
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.
When accessibilityRole is set to "header" in RN-core, the native values that are updated (Heading for Android and accessibilityTrait for iOS) are the same values that used by screen readers to determine if some text is a heading. On Windows, screen readers check the UIA Heading Level to determine if something is a heading -- this PR sets the UIA Heading Level to a default level 2 whenever accessibilityRole="header" in Text. This will match the behavior in RN-core, although we might want to create a windows-specific prop down the road to allow for control over the exact heading level passed to UIA.
Also included is an update to automationProperties.localizedControlTypeProperty when setting accessibilityRole in Text as a slight improvement for #8191 until we decide on a workaround for custom automation peer functionality for Text.
Testing: Tested using Narrator and Accessibility Insights For Windows. When accessibilityRole="header" is set on a Text component Narrator Scan mode announces the heading as expected and Accessibility Insights shows the localizedControlTypeProperty as "header".
Microsoft Reviewers: Open in CodeFlow