Skip to content

Commit 7fb02bd

Browse files
Emily Janzerfacebook-github-bot
Emily Janzer
authored andcommitted
Rename onAccessibilityAction event on Android
Summary: D15391408 (#24695) added a new event type with the registration name 'onAccessibilityAction' on Android, using the key 'performAction'. On iOS the same event uses the key 'topAccessibilityAction', which caused a runtime error after I started registering both using the unified JS view config in D15488008. This diff changes Android to use the same name as iOS since the convention is to start with 'top'. Reviewed By: cpojer Differential Revision: D15542623 fbshipit-source-id: c339621d2b4d3e1700feb5419ae3e3af8b185ca8
1 parent 99bb710 commit 7fb02bd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ protected void onAfterUpdateTransaction(@Nonnull T view) {
376376
@Override
377377
public @Nullable Map<String, Object> getExportedCustomDirectEventTypeConstants() {
378378
return MapBuilder.<String, Object>builder()
379-
.put("performAction", MapBuilder.of("registrationName", "onAccessibilityAction"))
379+
.put("topAccessibilityAction", MapBuilder.of("registrationName", "onAccessibilityAction"))
380380
.build();
381381
}
382382
}

ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public boolean performAccessibilityAction(View host, int action, Bundle args) {
183183
ReactContext reactContext = (ReactContext)host.getContext();
184184
reactContext.getJSModule(RCTEventEmitter.class).receiveEvent(
185185
host.getId(),
186-
"performAction",
186+
"topAccessibilityAction",
187187
event);
188188
return true;
189189
}

0 commit comments

Comments
 (0)