mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Popups calling error callback instead of crashing if view with passed tagId not found
Summary: The showPopup method has an error callback. For some reason, it is asserting in case the wrong tagId is passed instead of calling the error callback on Android. Pass not existing tagId to showPopup method and make sure it is receiving an error in js instead of crashing in native on Android. [ANDROID] [MINOR] showPopup method calls error callback instead of crashing on errors. Closes https://github.com/facebook/react-native/pull/17550 Differential Revision: D6776014 Pulled By: hramos fbshipit-source-id: 1d97b762818d1591018fd43556eb41c3fb491eb9
This commit is contained in:
committed by
Facebook Github Bot
parent
70d23e82ad
commit
0c18ec5b9c
@@ -266,20 +266,23 @@ public class UIViewOperationQueue {
|
||||
private final class ShowPopupMenuOperation extends ViewOperation {
|
||||
|
||||
private final ReadableArray mItems;
|
||||
private final Callback mError;
|
||||
private final Callback mSuccess;
|
||||
|
||||
public ShowPopupMenuOperation(
|
||||
int tag,
|
||||
ReadableArray items,
|
||||
Callback error,
|
||||
Callback success) {
|
||||
super(tag);
|
||||
mItems = items;
|
||||
mError = error;
|
||||
mSuccess = success;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
mNativeViewHierarchyManager.showPopupMenu(mTag, mItems, mSuccess);
|
||||
mNativeViewHierarchyManager.showPopupMenu(mTag, mItems, mSuccess, mError);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -651,7 +654,7 @@ public class UIViewOperationQueue {
|
||||
ReadableArray items,
|
||||
Callback error,
|
||||
Callback success) {
|
||||
mOperations.add(new ShowPopupMenuOperation(reactTag, items, success));
|
||||
mOperations.add(new ShowPopupMenuOperation(reactTag, items, error, success));
|
||||
}
|
||||
|
||||
public void enqueueCreateView(
|
||||
|
||||
Reference in New Issue
Block a user