mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook Github Bot
parent
99bb710617
commit
7fb02bd908
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user