-
Notifications
You must be signed in to change notification settings - Fork 25k
Description
Description
Collections on Android have a CollectionInfo property which defines the size of the entire collection, and whether those elements are in rows, columns, or both. This information will be announced as part of the "in list" and "out of list" announcements, as well as when the list scrolls. Currently React Native does not support any way to define this information, and also doesn't support the list/grid/pager roles required to surface it.
Position in Collection not from collection Not supported by:
- Flatlist Position in Collection not supported by Flatlist #30973
- SectionList Position in Collection not supported by SectionList #30974
- VirtualizedList Position in Collection not supported by VirtualizedList #30975
- ScrollView Position in Collection not supported by ScrollView #30976
Since this behavior depends on both the collection info being present and the component having the proper accessibility role set, this task is dependent on #30839.
React Native version:
v0.63
Expected Behavior
On focus of a list component, screen readers should announce "In list, N items". Upon scroll of the list via the next page/previous page gestures, it should announce "Showing items X to Y of Z".
Android Details
Collection-type views on android (lists, grids, and pagers) all have a CollectionInfo object attached to their AccessibilityNodeInfo. This CollectionInfo object contains the total count of the items in the collection, how many rows the collection has, how many columns it has, and whether its hierarchical. Each item in the collection (ie. every direct child element) has a CollectionItemInfo object on its AccessibilityNodeInfo. This object defines the row/column index, the row/column span, and whether the item is selected and whether it is a heading.
https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo
https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo
Right now, some of this information might be being added to these list components, depending on what native Android components they are being mapped to. But it's currently not being surfaced to the user if that is the case, due to the components not having the ability to set (or a hard coded value set) of the proper accessibilityRole.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status