react-native icon indicating copy to clipboard operation
react-native copied to clipboard

feat: Add role prop to Text component

Open gabrieldonadel opened this issue 3 years ago • 3 comments

Summary

As pointed out by @necolas on https://github.com/facebook/react-native/issues/34424#issuecomment-1261482517 we forgot we add the role prop mapping to the Text component. This PR adds a new role prop to Text, mapping the web role values to the already existing accessibilityRole prop and moves the roleToAccessibilityRoleMapping to a common file that can be imported by both the Text and View components as requested on https://github.com/facebook/react-native/issues/34424. This PR also updates the RNTester AcessebilityExample to include a test using this new prop.

Changelog

[General] [Added] - Add role prop to Text component

Test Plan

  1. Open the RNTester app and navigate to the Accessibility Example page
  2. Test the role prop through the Text with role = heading section

gabrieldonadel avatar Oct 14 '22 00:10 gabrieldonadel

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,777,909 +486
android hermes armeabi-v7a 7,178,967 +537
android hermes x86 8,090,829 +399
android hermes x86_64 8,062,605 +485
android jsc arm64-v8a 9,636,993 +112
android jsc armeabi-v7a 8,401,283 +115
android jsc x86 9,586,189 +131
android jsc x86_64 10,179,350 +124

Base commit: 5d8a712fd55a63b6d8778aad32af1583d5c5201a Branch: main

analysis-bot avatar Oct 14 '22 01:10 analysis-bot

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 5d8a712fd55a63b6d8778aad32af1583d5c5201a Branch: main

analysis-bot avatar Oct 14 '22 01:10 analysis-bot

@jacdebug would you mind rereviwing this PR?

gabrieldonadel avatar Oct 20 '22 12:10 gabrieldonadel

@jacdebug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar Oct 21 '22 17:10 facebook-github-bot

This pull request was successfully merged by @gabrieldonadel in 20718e6b8ce4f5c3a8393067d5e8eb0da910751c.

When will my fix make it into a release? | Upcoming Releases

react-native-bot avatar Oct 24 '22 15:10 react-native-bot