Skip to content

Commit

Permalink
Rename onAccessibilityAction event on Android
Browse files Browse the repository at this point in the history
Summary: D15391408 (facebook#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
  • Loading branch information
Emily Janzer authored and M-i-k-e-l committed Mar 10, 2020
1 parent ea85977 commit c520f5e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -388,7 +388,7 @@ protected void onAfterUpdateTransaction(@Nonnull T view) {
@Override
public @Nullable Map<String, Object> getExportedCustomDirectEventTypeConstants() {
return MapBuilder.<String, Object>builder()
.put("performAction", MapBuilder.of("registrationName", "onAccessibilityAction"))
.put("topAccessibilityAction", MapBuilder.of("registrationName", "onAccessibilityAction"))
.build();
}
}
Expand Up @@ -183,7 +183,7 @@ public boolean performAccessibilityAction(View host, int action, Bundle args) {
ReactContext reactContext = (ReactContext)host.getContext();
reactContext.getJSModule(RCTEventEmitter.class).receiveEvent(
host.getId(),
"performAction",
"topAccessibilityAction",
event);
return true;
}
Expand Down

0 comments on commit c520f5e

Please sign in to comment.