Files
react-native/packages/react-native/Libraries/Text/__tests__
Nick Gerleman 19699ab3b5 Native ARIA Roles: Remove JS Shim (#37304)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37304

### Stack

ARIA roles in React Native are implemented on top of accessibilityRole. This is lossy because there are many more ARIA roles than accessibilityRole. This is especially true for RN on desktop where accessibilityRole was designed around accessibility APIs only available on mobile.

This series of changes aims to change this implementation to instead pass the ARIA role to native, alongside any existing accessibilityRole. This gives the platform more control in exactly how to map an ARIA role to native behavior.

As an example, this would allow mapping any ARIA role to AutomationControlType on Windows without needing to fork to add new options to accessibilityRole.

It also allows greater implementation flexibility for other platforms down the line, but for now, iOS and Android behave the same as before (though with their implementation living in native).

### Diff

This removes the JS shimming of `role` to `accessibilityRole`. It can be landed when the native `role` implementation for both iOS and Android are live for versions we service out of band.

This will require any out of tree platforms to add their own native implementation for `role` to continue to work.

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D45432518

fbshipit-source-id: 02ac28049a029381af019c042fc7f37833f4157c
2023-06-16 13:21:49 -07:00
..