Add Support for accessibiliyActions #13316
Labels
Area: Accessibility
Area: Fabric
Support Facebook Fabric
enhancement
New Architecture
Broad category for issues that apply to the RN "new" architecture of Turbo Modules + Fabric
Parity: Fabric vs. Paper
RNW Fabric does not look or behave like RNW Paper
Workstream: Accessibility
Ensure RNW Fabric apps are properly accessible.
Milestone
Documentation
accessibilityActions Documentation: https://reactnative.dev/docs/accessibility#accessibility-actions
Behavior Explanation
From documentation:
"To support accessibility actions, a component must do two things:
Define the list of actions it supports via the accessibilityActions property.
Implement an onAccessibilityAction function to handle action requests."
For example a developer will define the following control:
They have defined a set of accessibilityActions they expect to occur for this control, and they have defined an onAccessibilityAction function which should be called after one of the defined accessibilityActions takes place.
On the native side, our platform must store the information that this View control wants to know when Toggle, Invoke, Expand, and Collapse UIA events occur. The native code should monitor when a Toggle, Invoke, Expand, or Collapse UIA event is fired and call the onAccessibilityAction event handler the developer defined with the event information.
Implementation Plan
In our native implementation of accessibilityActions we must:
Note this prop will not need to be implemented per component. One implementation in the accessibility source will serve all component types. (i.e. per component issues linked below can all be closed at once after prop behavior is implemented)
Past Implementation
Implementation on Paper: #3475
Issue on Paper: #2765
Notes
Implementing accessibilityActions should not implement our native handling of UIA events. For example, toggling a Switch control when a UIA Toggle event is fired should not be handled by this feature work. That is a separate task. See #11903
To Be Clarified
It is unclear in the documentation if specification accessibilityActions and the onAccessibilityAction handler should override default accessibility event behavior. For example, our native code will handle Invoke events for the Button control by calling the controls onPress function. If a developer was to create a Button control and specify the accessibilityActions prop to be
{ name: 'invoke', label: 'invoke' }
and the onAccessibilityAction handler to beshould the onAccessibilityAction call replace the default handling of the Invoke event within our native code or be in addition to?
Completed
Tasks
The text was updated successfully, but these errors were encountered: