You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
When using the react-native-reanimated-carousel library with the loop property enabled, the carousel creates duplicate elements to achieve the infinite scrolling effect. However, these duplicate elements are not properly hidden from accessibility services (e.g., screen readers like VoiceOver or TalkBack). This results in the following accessibility issues:
Screen readers announce carousel items multiple times, including for invisible duplicates.
The accessibilityElementsHidden property or similar methods do not correctly hide non-visible elements, causing confusion for users relying on accessibility tools.
Steps to Reproduce
Create a carousel with
2 or more items. Enable the loop property.
Use a screen reader (VoiceOver on iOS or TalkBack on Android) to navigate through the carousel.
Notice that:
Items are announced multiple times (including duplicates).
Invisible duplicates are not properly excluded from the accessibility tree.
Expected Behavior
When loop is enabled:
Only the currently visible carousel item should be focusable and announced by the screen reader.
Duplicated invisible elements (used for looping) should be excluded from the accessibility tree
Hey @oleksiizhuk! I'm here to help you with any bugs, questions, or contributions. Let's tackle this issue together!
I found a similar open issue regarding accessibility concerns with duplicate elements when the loop property is enabled in the react-native-reanimated-carousel. The suggested workaround involves using the accessibilityElementsHidden property to hide non-visible elements from screen readers. Here's the proposed solution:
<Carousel{...}ref={carouselRef}renderItem={({ index })=>(<ViewaccessibilityElementsHidden={index!==carouselRef.current?.getCurrentIndex()}><Image…/></View>)}/>
This approach was tested on iOS and reportedly works well [1].
Problem
When using the react-native-reanimated-carousel library with the loop property enabled, the carousel creates duplicate elements to achieve the infinite scrolling effect. However, these duplicate elements are not properly hidden from accessibility services (e.g., screen readers like VoiceOver or TalkBack). This results in the following accessibility issues:
Steps to Reproduce
Expected Behavior
When loop is enabled:
Actual Behavior
When loop is enabled:
Code Example
Screen.Recording.2025-01-23.at.12.33.00.mov
The text was updated successfully, but these errors were encountered: