Skip to content

Android: One element labelling another #30846

Description

@amarlette

Requires API Proposal

This issue requires a new 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

No concept of "labelFor" or "labeledBy" or any way to pass a reference to another element as the accessibilityLabel property of an element. Used most when building complex forms.

React Native version:

v0.63

Expected Behavior

Android has a labelFor property on View, which allows you to pass a reference to the ID of another view, that this view should act as the label for. When Focusing on the other view, it will announce for <other view's label>.

For example, if you have these two Views

<Text labelFor="123">Wifi</Text>
<Checkbox accessibilityLabel="checkbox" id="123" />

And you focus on the checkbox, it would announce "checkbox for Wifi".

Android Details

Any API to add this feature should manipulate the underlying View's labelFor property. It will need a reference of the ID of the element that is being labelled to properly work.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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