fix: add 'tabbar' to role type for accessibility #54512
Open
+1
−0
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.
Summary:
The
tabbarrole was removed fromAccessibilityRolein 2018 (commit f39d092) as it was only available on iOS 10+. It was later added back toAccessibilityRoleonce the minimum iOS version increased.However, when the separate
Roletype was introduced in 2022 for the role prop,tabbarwas not included despite being present inAccessibilityRole. This inconsistency causes TypeScript compilation errors when trying to use role="tabbar" on components, even though it's a valid and working accessibility role that exists inAccessibilityRole.This PR adds
tabbarto the Role type definition to maintain consistency between AccessibilityRole and Role, allowing developers to use this role without TypeScript errors and for accurate announcements for screen reader users.Changelog:
Test Plan:
Before this change, the following TypeScript code would fail compilation:
After this change, the code compiles successfully. The
tabbarrole also already exists inAccessibilityRole(line 213 ofViewAccessibility.d.ts) and works correctly at runtime on all currently supported iOS versions.