Skip to content

Android: Entrance/exit from collection #30861

Closed
facebook/react-native-website
#3224
@amarlette

Description

@amarlette

Requires API Proposal

This issue may require a new API or a change to an existing API. An API proposal should be added and discussed before proceeding with implementation. The API proposal can be added in the comments of this issue or linked as a separate issue.

Description

Entrance/exit from collection Not supported by:

No components can be set as any collection role. With support for "List" or "Grid" roles would these would likely work as expected.

React Native version:

v0.63

Snack

https://snack.expo.io/Dh_iVb7F5

Expected Behavior

When first focusing into a collection element, screen readers will announce "in " (e.g. list, grid, pager, etc.), and when first focusing out of a collection, it will announce "out of ". This behavior happens automatically if the element has the proper role applied.

Android Details

This behavior is hinged on adding the proper accessibility role for these elements. Right now the accessibilityRole prop does not support a role of "list", "grid", or "pager" (the 3 collection types on Android), and adding them would be one solution to this problem. These roles could instead be set directly by the Android implementations for the above list components if we don't want to support these roles elsewhere.

To do this, you will need to set the className property on the AccessibilityNodeInfo associated with the list's View in Java to the role that Talkback expects (shown here: https://github.com/google/talkback/blob/master/utils/src/main/java/Role.java).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions