Open heathercodes opened 1 year ago
Hello, @heathercodes! Thanks for reaching out about these issues.
pressable-role-required
. It's a sanity check, but we haven't added tab
to the list of reasonable pressable roles. This seems like a simple fix, if you'd like to open a PR. Otherwise, I can get to it this weekend.thank you! I'll make a PR for issue 1 shortly
Ready for your review! https://github.com/aryella-lacerda/react-native-accessibility-engine/pull/308
hey @aryella-lacerda wondered if you had looked into the accessibility for carousels at all?
on my end, while implementing the carousel for my app, in the component that wraps each item in the carousel, I tried making it accessible by using accessibilityElementsHidden
and importantForAccessibility
. Wondered if this made sense to you?
<View
key={key || `${index}-content`}
accessibilityElementsHidden={index !== selectedIndex}
importantForAccessibility={
index === selectedIndex ? 'auto' : 'no-hide-descendants'
}
>
{children} // carousel item here
</View>
If you hadn't had a chance to look into it, that's also ok! we can likely close up this issue in any event.
Thanks!
Describe the bug I'm building a TabBar component using a Carousel library, and noticed that the
toBeAccessible
RTL helper is calling out the wrong things:"tab" role is flagged as incorrect my first attempt at building a TabBar component used react-native-tab-view with a Custom header and tabs. While testing the component, I noticed, that while adding
accessibilityRole
oftablist
to the header component was flagged as correct, the TabBar items, the tabs themselves with anaccessibilityRole
oftab
was incorrect. This library wanted me to change it tobutton
."accessibilityState" is required for carousels I moved onto another library (for unrelated reasons to the above) and while using a carousel library react-native-reanimated-carousel. While this library has other accessibility issues I won't get into, this library called out that an
accessibilityState
with disabled boolean prop was required to be passed all the way to the base View component. While doing some research, however, I noted that other accessible carousel libraries do not do this, but instead have other accessibility props:accessible
propaccessibilityElementsHidden
andimportantForAccessibility
on focus insteadComponent under test 1. use the basic set up of: https://github.com/satya164/react-native-tab-view#quick-start
and this will flag:
2. use the basic set up of: https://github.com/dohooo/react-native-reanimated-carousel#usage
and this will flag:
Expected behavior
accessibilityState
should not be the only prop flagged if other props (accessible, accessibilityElementsHidden, etc.) already exist.Context