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:
Store the registered accessibilityActions event names (most likely via CompositionDynamicAutomationProvider)
Store a new AccessibilityActionsEventHandler property with a name parameter
When a UIA action occurs, check the registered accessibilityActions names and if there's a match, then fire the AccessibilityActionsEventHandler
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 https://github.com/microsoft/react-native-windows/issues/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 be
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 https://github.com/microsoft/react-native-windows/issues/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