Rename onAccessibilityAction event on Android

Summary: D15391408 (https://github.com/facebook/react-native/pull/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
This commit is contained in:
Emily Janzer
2019-05-30 16:00:26 -07:00
committed by Facebook Github Bot
parent 99bb710617
commit 7fb02bd908
2 changed files with 2 additions and 2 deletions
@@ -376,7 +376,7 @@ public abstract class BaseViewManager<T extends View, C extends LayoutShadowNode
@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();
}
}
@@ -183,7 +183,7 @@ public class ReactAccessibilityDelegate extends AccessibilityDelegateCompat {
ReactContext reactContext = (ReactContext)host.getContext();
reactContext.getJSModule(RCTEventEmitter.class).receiveEvent(
host.getId(),
"performAction",
"topAccessibilityAction",
event);
return true;
}