Skip to content

Commit

Permalink
Fix onAccessibilityAction on Fabric (#35507)
Browse files Browse the repository at this point in the history
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

Pull Request resolved: #35507

Test Plan: #35507 (comment)

Reviewed By: javache

Differential Revision: D41707777

Pulled By: philIip

fbshipit-source-id: 0f4550a17f4b8bfc1aefa404059b367907f8f60d
  • Loading branch information
fabOnReact authored and facebook-github-bot committed Dec 9, 2022
1 parent 4f142bf commit 006527f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import com.facebook.react.bridge.UIManager;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.uimanager.ReactAccessibilityDelegate.AccessibilityRole;
import com.facebook.react.uimanager.common.ViewUtil;
import com.facebook.react.uimanager.events.Event;
import com.facebook.react.uimanager.events.EventDispatcher;
import com.facebook.react.uimanager.util.ReactFindViewUtil;
Expand Down Expand Up @@ -420,7 +421,8 @@ public boolean performAccessibilityAction(View host, int action, Bundle args) {
if (reactContext.hasActiveReactInstance()) {
final int reactTag = host.getId();
final int surfaceId = UIManagerHelper.getSurfaceId(reactContext);
UIManager uiManager = UIManagerHelper.getUIManager(reactContext, reactTag);
UIManager uiManager =
UIManagerHelper.getUIManager(reactContext, ViewUtil.getUIManagerType(reactTag));
if (uiManager != null) {
uiManager
.<EventDispatcher>getEventDispatcher()
Expand Down

0 comments on commit 006527f

Please sign in to comment.