-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Fabric] Add Support for accessibilityActions and onAccessibilityAction #13674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| if (spProviderSimple != nullptr) { | ||
| UiaRaiseAutomationEvent(spProviderSimple.get(), UIA_Invoke_InvokedEventId); | ||
| } | ||
| DispatchAccessibilityAction(m_view, "invoke"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a difference between these two?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the action should be the same. "activate" is just the action name that RN is using and "invoke" is the Windows name for the same action. I figured we should just support both names, so the user can either use the windows action name or the cross-plat action name.
…on (microsoft#13674) * Add Implementation for accessibilityActions * Add activate action * Format * Change files
* Introduce ReactNativeAppBuilder (#13368) * Introduce ReactNativeAppBuilder.idl * yarn format fix * Change files * Address feedback * Add a fabric check for ReactNativeAppBuilder * yarn format * Update reactnativeappbuilder (#13467) * Build reactnativeappbuilder * Setup reactnativewin32 app * Fix dispatcherqueue issue * Change files * Cleanup * Address feedback * Address feedback2 * Fix pipeline error * Fix pipeline errors * Address feedback * [Fabric] Fix crash when running inspect (#13592) * [Fabric] Fix crash when running inspect * Change files * fix * [Fabric] LogBox should destroy its window on instance shutdown (#13675) * [Fabric] LogBox should destroy its window on instance shutdown * Change files * format * [Fabric] Add FocusNavigationDirection and allow overriding of default command handling (#13857) * [Fabric] Add FocusNavigationDirection and allow overriding of default command handling * Change files * revert packages.lock * [Fabric] LayoutDirection and FontSizeMultiplier support (#13866) * [Fabric] LayoutDirection and FontSizeMultiplier support * Change files * Missed a few places not setting LayoutDirection * fix crash on logbox * Fix textinput caret * fix * RichEdit has to be told its multiline before we can set a multiline string * Update SampleAppFabric to use ReactNativeAppBuilder (#13382) * Update SampleAppFabric to use ReactNativeAppBuilder * Yarn format fix * Address feedback to keep BUNDLE and DEBUG * Yarn format * Change files * Setup the DebugBundlePath when loading from metro * fix typo * [Fabric] Enable ScrollView touch scrolling (#13664) * [Fabric] Enable ScrolView touch scrolling * Change files * format * typo * [Fabric] Add Support for accessibilityActions and onAccessibilityAction (#13674) * Add Implementation for accessibilityActions * Add activate action * Format * Change files * Use a legacy native module binding that always returns null in bridgeless mode (#13905) * Use a legacy native module binding that always returns null in bridgeless mode * Change files * format * SampleTurboModule only works as a turbomodule, so do not install it when using web debugger (#13911) * SampleTurboModule only works as a turbomodule, so do not install it when using web debugger * Change files * fix * Implement the SampleTurboModule module (#13541) This PR provides a proper implementation of the `SampleTurboModule` module and removes the proxy code in `TurboModuleManager` which instead substituted the old `SampleTurboCxxModule` module. - New feature (non-breaking change which adds functionality) The APIs of `SampleTurboModule` are starting to deviate from the older `SampleTurboCxxModule`, specifically the addition of new `EventEmitter` members. So it's time we had a "real" implementation of `SampleTurboModule`. Closes #13531 See above. N/A Verified tests still pass and the new module is being called. Should this change be included in the release notes: _yes_ Implement the SampleTurboModule module * fix previous merge * fix bad merge * fix more typos * update snapshots --------- Co-authored-by: Sharath Manchala <10109130+sharath2727@users.noreply.github.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Co-authored-by: Jon Thysell <jthysell@microsoft.com>
…on (microsoft#13674) * Add Implementation for accessibilityActions * Add activate action * Format * Change files
* Introduce ReactNativeAppBuilder (#13368) * Introduce ReactNativeAppBuilder.idl * yarn format fix * Change files * Address feedback * Add a fabric check for ReactNativeAppBuilder * yarn format * Update SampleAppFabric to use ReactNativeAppBuilder (#13382) * Update SampleAppFabric to use ReactNativeAppBuilder * Yarn format fix * Address feedback to keep BUNDLE and DEBUG * Yarn format * Change files * Setup the DebugBundlePath when loading from metro * Update reactnativeappbuilder (#13467) * Build reactnativeappbuilder * Setup reactnativewin32 app * Fix dispatcherqueue issue * Change files * Cleanup * Address feedback * Address feedback2 * Fix pipeline error * Fix pipeline errors * Address feedback * Implement the SampleTurboModule module (#13541) This PR provides a proper implementation of the `SampleTurboModule` module and removes the proxy code in `TurboModuleManager` which instead substituted the old `SampleTurboCxxModule` module. - New feature (non-breaking change which adds functionality) The APIs of `SampleTurboModule` are starting to deviate from the older `SampleTurboCxxModule`, specifically the addition of new `EventEmitter` members. So it's time we had a "real" implementation of `SampleTurboModule`. Closes #13531 See above. N/A Verified tests still pass and the new module is being called. Should this change be included in the release notes: _yes_ Implement the SampleTurboModule module * [Fabric] Fix crash when running inspect (#13592) * [Fabric] Fix crash when running inspect * Change files * fix * [Fabric] Enable ScrollView touch scrolling (#13664) * [Fabric] Enable ScrolView touch scrolling * Change files * format * typo * [Fabric] Add Support for accessibilityActions and onAccessibilityAction (#13674) * Add Implementation for accessibilityActions * Add activate action * Format * Change files * [Fabric] LogBox should destroy its window on instance shutdown (#13675) * [Fabric] LogBox should destroy its window on instance shutdown * Change files * format * [Fabric] Add FocusNavigationDirection and allow overriding of default command handling (#13857) * [Fabric] Add FocusNavigationDirection and allow overriding of default command handling * Change files * revert packages.lock * [Fabric] LayoutDirection and FontSizeMultiplier support (#13866) * [Fabric] LayoutDirection and FontSizeMultiplier support * Change files * Missed a few places not setting LayoutDirection * fix crash on logbox * Fix textinput caret * fix * RichEdit has to be told its multiline before we can set a multiline string * Use a legacy native module binding that always returns null in bridgeless mode (#13905) * Use a legacy native module binding that always returns null in bridgeless mode * Change files * format * SampleTurboModule only works as a turbomodule, so do not install it when using web debugger (#13911) * SampleTurboModule only works as a turbomodule, so do not install it when using web debugger * Change files * fix * merge conflicts * format * fix * lint fix * fix * fix * update snapshots --------- Co-authored-by: Sharath Manchala <10109130+sharath2727@users.noreply.github.com> Co-authored-by: Jon Thysell <jthysell@microsoft.com> Co-authored-by: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Co-authored-by: React-Native-Windows Bot <53619745+rnbot@users.noreply.github.com>
Description
Type of Change
Why
Bring Fabric to API parity with Paper.
Resolves [Add Relevant Issue Here]
What
This PR adds initial native support for the accessibilityActions and onAccessibilityAction props. In this PR we add support for the "invoke", "scrollIntoView", "setValue", and "toggle" actions. These are actions specific to the Windows platform. This PR also adds support for the "activate" action which is a cross-platform action.
As we add support for other UIA providers to Fabric, we will be able to expand the list of accessibilityActions we can support.
Note the onAccessibilityAction event emitter only supports specifying an action name at this time, so for the Windows setValue action, there is currently no way to pass the new value back to the JS. This infrastructure could be added. The code sample below captures how we would do this:



If we wanted to add this infrastructure, we should coordinate with React Native to make sure this would be a change they'd want to upstream, so that all platforms have a consistent API for onAccessibilityAction.
Testing
Tested locally. No infrastructure in E2E tests yet to have automated tests for assistive tech interaction.
Changelog
Should this change be included in the release notes: Yes
Add support for "activate", "invoke", "scrollIntoView", "setValue", and "toggle" accessibilityActions.