DataDog / dd-sdk-reactnative

Datadog SDK for ReactNative
Apache License 2.0
121 stars 42 forks source link

Extend accessibilityLabel support to aria-label prop alias #724

Open leggomuhgreggo opened 3 weeks ago

leggomuhgreggo commented 3 weeks ago

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

*not yet supported

marco-saia-datadog commented 1 week ago

Hi @leggomuhgreggo 👋

Thank you for your detailed suggestion, it is definitely something we want to introduce to align our SDK with this new React Native standard.

We have included this in our roadmap :)