Skip to content
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

Fix onAccessibilityAction on Fabric #35507

Closed
wants to merge 1 commit into from

Conversation

fabOnReact
Copy link
Contributor

@fabOnReact fabOnReact commented Nov 29, 2022

Summary

fixes #30841 (comment). onAccessibilityAction does not work on Fabric and logs:

E/unknown:ReactEventEmitter( 3845): com.facebook.react.bridge.ReactNoCrashSoftException: 
Cannot find EventEmitter for receiveEvent: SurfaceId[1] ReactTag[104] UIManagerType[2] 

Changelog

[Android] [Fixed] - Fix onAccessibilityAction on Fabric

Test Plan

#35507 (comment)

ReactAccessibilityDelegate performAccessibilityAction dispatches the event topAccessibilityAction
--
Understand why Fabric does not call registerEventEmitter before performAccessibilityAction for that reactTag/surfaceId
Read StackTrace from error message (use printStacktrace)
The method getUIManager retrieve the UIManager from the reactTag and does not check if is Fabric or Paper

ReactAccessibilityDelegate [performAccessibilityAction](https://github.com/facebook/react-native/blob/bf37a34c38b39a14de8194520d07de0b9f8c0bf7/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java#L410-L415) dispatches the event topAccessibilityAction
Understand why Fabric does not call [registerEventEmitter](https://github.com/fabriziobertoglio1987/react-native/blob/163171ccab6937785f4f3c85e011bd14540bebf5/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java#L426) before performAccessibilityAction for that reactTag/surfaceId
Read StackTrace from [error message](facebook#30841 (comment)) (use [printStacktrace](https://www.google.com/search?q=java+printStacktrace))
The method [getUIManager](https://github.com/fabriziobertoglio1987/react-native/blob/dc4c54ec1b7b7f7cd37c7402b1eac5292cb4996a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerHelper.java#L40-L48) retrieve the UIManager from the reactTag and does not check if is Fabric or Paper
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 29, 2022
@fabOnReact
Copy link
Contributor Author

CLICK TO OPEN TESTS RESULTS

2022-11-29.17-02-00.mp4

@react-native-bot react-native-bot added Bug Platform: Android Android applications. labels Nov 29, 2022
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: dccb57f
Branch: main

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,102,090 +173
android hermes armeabi-v7a 6,470,975 +172
android hermes x86 7,520,409 +172
android hermes x86_64 7,378,920 +166
android jsc arm64-v8a 8,967,193 -58
android jsc armeabi-v7a 7,698,675 -66
android jsc x86 9,030,004 -55
android jsc x86_64 9,507,631 -71

Base commit: dccb57f
Branch: main

@fabOnReact fabOnReact marked this pull request as ready for review November 29, 2022 16:23
@pull-bot
Copy link

PR build artifact for 69d43f8 is ready.
To use, download tarball from "Artifacts" tab in this CircleCI job then run yarn add <path to tarball> in your React Native project.

@pull-bot
Copy link

PR build artifact for 69d43f8 is ready.
To use, download tarball from "Artifacts" tab in this CircleCI job then run yarn add <path to tarball> in your React Native project.

@facebook-github-bot
Copy link
Contributor

@philIip has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Dec 9, 2022
@facebook-github-bot
Copy link
Contributor

@philIip merged this pull request in 006527f.

OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
fixes facebook#30841 (comment). onAccessibilityAction does not work on Fabric and logs:

```
E/unknown:ReactEventEmitter( 3845): com.facebook.react.bridge.ReactNoCrashSoftException:
Cannot find EventEmitter for receiveEvent: SurfaceId[1] ReactTag[104] UIManagerType[2]
```

## Changelog

[Android] [Fixed] - Fix onAccessibilityAction on Fabric

Pull Request resolved: facebook#35507

Test Plan: facebook#35507 (comment)

Reviewed By: javache

Differential Revision: D41707777

Pulled By: philIip

fbshipit-source-id: 0f4550a17f4b8bfc1aefa404059b367907f8f60d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accessibility Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Platform: Android Android applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android: Expandable/Collapsible State
6 participants