-
Notifications
You must be signed in to change notification settings - Fork 278
Closed
Labels
Description
Describe the bug
react-native built-in elements are not queriable with byRole queries if you don't set the accessibilityRole prop.
Expected behaviour
byRole queries should be able to match some elements without accessibilityRole.
We however need to be conscious of what roles should be used to match what elements. My suggestion is checking each element with a voice-over and see what matches:
- should
<Pressable />bebuttonby default? <TextInput />will readInputon ios voiceover, but that is not anAccessibilityRoleas exported byreact-native.
We might need to think about types. The point raised in #1127 (comment) that suggests using TextMatch for the role will make it harder to discover those cases.
Steps to Reproduce
Unable to find an element with accessibilityRole: image
140 | const { getByRole } = render(<Image />);
141 |
> 142 | getByRole('image');
| ^
143 | });
144 | });
145 |Versions
Latest.
Reactions are currently unavailable