Repository navigation
fix(navigation-bar): read tabs as tabs with position in VoiceOver - #5360
Open
Priyanshu0007 wants to merge 1 commit into
Open
Priyanshu0007 wants to merge 1 commit into
Priyanshu0007 wants to merge 1 commit into
Conversation
React Native maps role="tab" and role="tablist" to no iOS trait, so VoiceOver read the tabs as plain buttons. On iOS the tab container now uses accessibilityRole="tabbar" (UIAccessibilityTraitTabBar) and is kept unflattened, so VoiceOver reads each tab as "Tab, N of M". Fixes callstack#5351
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
VoiceOver read tabs as plain buttons with no position. RN gives iOS no trait for
role="tab"/"tablist", and the tablist View was flattened. On iOS the container now usesaccessibilityRole="tabbar"andcollapsable={false}. Android and web are unchanged.Related issue
Fixes #5351
Screenshots / Videos
Before, then after.
iOS
navigation-bar-tabs-ios-before.mp4
navigation-bar-tabs-ios-after.mp4
Android
navigation-bar-tabs-android-before.mp4
navigation-bar-tabs-android-after.mp4
Web
navigation-bar-tabs-web-before.mp4
navigation-bar-tabs-web-after.mp4
Test plan
On iOS, open the NavigationBar example and swipe the tabs with VoiceOver: each reads "Tab, N of 4".