microsoft / react-native-windows

A framework for building native Windows apps with React.
https://microsoft.github.io/react-native-windows/
Other
16.24k stars 1.13k forks source link

Paper and Fabric's mapping of accessibilityRole to UIA ControlType does not conform with the ARIA Core AAM #11432

Open FalseLobster opened 1 year ago

FalseLobster commented 1 year ago

Problem Description

Meta introduced a number of new higher-precedence aria- props in 0.71, including a new role prop, and seems to be increasingly converging with ARIA standards. While adding support for accessibility in Fabric I noticed that a number of the role mappings used by Paper are not consistent with the ARIA Core AAM (Accessibility API mapping, spec-ing how ARIA props should map to native accessibility frameworks). Here's the current role mapping table showing how aria roles translate to UIA Control Types and other associated UIA APIs. (Note there is a editor's draft of Core AAM v1.2 which can be found here).

Notably the following accessibilityRoles are inconsistent:

RN accessibilityRole Core AAM Control Type Paper Impl
alert UIA_GroupControlTypeId Text
radiogroup UIA_ListControlTypeId Group

We should understand the implications of this divergence and either correct the implementation of accessibilityRole on Paper and Fabric or consider mapping the new aria-inspired role prop accordingly.

Steps To Reproduce

See DynamicAutomationPeer and CompsositionDynamicAutomationProvider (in PR)

Expected Results

We should either correct accessibilityRole to map like the core aam specifies or implement the new role prop accordingly if that change is too breaking.

CLI version

11.0.0-alpha.2

Environment

System:
    OS: Windows 10 10.0.22621
    CPU: (20) x64 Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz
    Memory: 96.30 GB / 127.71 GB
  Binaries:
    Node: 18.15.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 9.5.0 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  Managers:
    RubyGems: Not Found
  SDKs:
    Android SDK: Not Found
    Windows SDK:
      AllowDevelopmentWithoutDevLicense: Enabled
      AllowAllTrustedApps: Enabled
      Versions: 10.0.17763.0, 10.0.18362.0, 10.0.19041.0, 10.0.22000.0
  IDEs:
    Android Studio: Not Found
    Visual Studio: 17.5.33502.453 (Visual Studio Enterprise 2022)
  Languages:
    Java: 11.0.16.1 - C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot\bin\javac.EXE
  npmPackages:
    @react-native-community/cli: Not Found
    react: Not Found
    react-native: Not Found
    react-native-windows: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Target Platform Version

10.0.19041

Target Device(s)

Desktop, Xbox, HoloLens

Visual Studio Version

Visual Studio 2022

Build Configuration

None

Snack, code example, screenshot, or link to a repository

See DynamicAutomationPeer and CompsositionDynamicAutomationProvider (in PR)

chrisglein commented 1 year ago

@AgneLukoseviciute FYI