Skip to content

Extend accessibilityLabel support to aria-label prop alias #724

Open
@leggomuhgreggo

Description

@leggomuhgreggo

Feature description

The idea would be to use aria-label the way accessibilityLabel is for interaction tracking

Background

React Native 0.71.3 added support for "web inspired" prop aliases [docs]

This release includes a number of new props inspired by web standards to align React Native’s APIs across many platforms. These new props are purely additive so there are no expected migrations or change of behavior for equivalent accessibility, behavior, or style props.

For any new prop alias introduced, if there is an existing prop with a different name and both are specified, the new alias prop value will take precedence. For example, this release adds a src prop alias for source on the Image component to align with the src prop on web. If both src and source are provided, the new src prop will be used.

This includes support for aria-label as a prop alias of accessibilityLabel

Note

The RFC and discussion, linked from the docs, may be useful, for additional context

Proposed solution

Extend the existing user interactions tracking feature, to support aria-label in addition to accessibilityLabel
https://docs.datadoghq.com/real_user_monitoring/mobile_and_tv_monitoring/setup/reactnative/#user-interactions-tracking

Other relevant information

It may be useful to consider parity with browser RUM, which also includes support for label and placeholder

I think in theory it would be possible but support for these in RN Is not a standard

  • label - aria-labelledby / accessibilityLabelledBy
  • placeholder - aria-placeholder* placeholder

*not yet supported

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions