Skip to content

Commit

Permalink
Rename onAccessibilityAction event on Android
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Emily Janzer authored and facebook-github-bot committed May 30, 2019
1 parent 99bb710 commit 7fb02bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,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();
}
}
Original file line number Diff line number Diff line change
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 7fb02bd

Please sign in to comment.