Feature: Rule to require accessibilityRole prop
Waltari10 opened this issue · comments
In our project we often get bugs that the screenreader is not reading the type of pressed element correctly or not at all. This is typically fixed by adding accessibilityRole prop. I was wondering if it would be possible to require accessibilityRole prop for react-native components like text and button? Everything has accessible={true}
prop anyway, so might as well.
Is this something that might be added in the future?
hey @Waltari10 -- thanks for this suggestion.
as i understand it, there isn't always a clear-cut requirement that every <Touchable*>
with accessible={true}
always requires accessibleRole
. my (current) understanding is it depends on both the child content of the <Touchable*>
in question as well as the other accessibility props.
for instance, the component might include other props like accessibilityLabel
and accessibilityHint
that succinctly describe the behaviour without an explicit accessibilityRole
. Here's an example of that taken from the AccessibilityExample in the main react-native repo.
so i don't think that's valid?
closing as stale -- please reopen if you wish to discuss further