-
Notifications
You must be signed in to change notification settings - Fork 276
Accessibility Behavior
Maciej Jastrzebski edited this page Oct 2, 2022
·
11 revisions
Methods of testing:
- iOS: using Accessibility Inspector (in iOS mode!) on iOS simulator
- Android: using TalkBack on Android emulator
| Component | Screen reader | Label | Value | Traits | Identifier | Hint | User Input Label |
|---|---|---|---|---|---|---|---|
<Text>Hello!</Text> |
Hello! | Hello ! | (none) | Static Text | (none) | (none) | Hello ! |
accessible={true} accessibilityRole="text" |
Hello! | Hello ! | (none) | Static Text | (none) | (none) | Hello ! |
accessible={true} |
Hello! | Hello ! | (none) | Static Text | (none) | (none) | Hello ! |
accessible={false} |
(ignored) | (ignored) | (ignored) | (ignored) | (ignored) | (ignored) | (ignored) |
accessibilityRole="text" |
Hello! | Hello ! | (none) | Static Text | (none) | (none) | Hello ! |
accessibilityRole="none" |
Hello! | Hello ! | (none) | (none) | (none) | (none) | Hello ! |
Findings:
- iOS behaves the same for when
accessible={true}or when prop is not specified - iOS behaves the same for when
accessibilityRole="text"or when prop is not specified - iOS ignores element when
accessible={false} - ichanging
accessibilityRoleto"none"removes Static Text trait, but view is still readable by screen reader
| Component | Screen reader |
|---|---|
<Text >Hello!</Text> |
Hello! |
accessible={true} accessibilityRole="text" |
Hello! |
accessible={true} |
Hello! |
accessible={false} |
Hello! |
accessibilityRole="text" |
Hello! |
accessibilityRole="none" |
Hello! |
importantForAccessibility="no" |
(ignored) |
importantForAccessibility="no-hide-descendants" |
(ignored) |
Findings:
- Android
accessibleprops does not affect TalkBack screen reader behaviour - Android
accessibilityRoleprops does not affect TalkBack screen reader behaviour - Android ignores element if
importantForAccessibilityvalue"no"or"no-hide-descendants"
- assume default
accessiblevalue oftrue - assume default
accessibilityRoleoftext - assume no role when
accessible={false}oraccessibilityRole="none"(based on iOS semantics) - assume no role when
importantForAccessibility="no"orimportantForAccessibility="no-hide-descendants"(based on Android semantics)