mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix modals freezing on close with Nodes
Summary: Modals were doing nothing (and sometimes crashing) when they were being closed. The reason for this was due to the fact that the parent being removed was not necessarily the view's parent. Consequently, trying to inform said parent that its child was removed failed, because said parent wasn't a view, and therefore had no record in mViewsToTags. Reviewed By: sriramramani Differential Revision: D3928850
This commit is contained in:
@@ -11,6 +11,8 @@ package com.facebook.react.flat;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.util.SparseIntArray;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -207,8 +209,12 @@ import com.facebook.react.uimanager.UIViewOperationQueue;
|
||||
|
||||
private final SparseIntArray mViewsToDrop;
|
||||
|
||||
private DropViews(SparseIntArray viewsToDrop) {
|
||||
mViewsToDrop = viewsToDrop;
|
||||
private DropViews(ArrayList<Integer> viewsToDrop, ArrayList<Integer> parentsForViewsToDrop) {
|
||||
SparseIntArray sparseIntArray = new SparseIntArray();
|
||||
for (int i = 0, count = viewsToDrop.size(); i < count; i++) {
|
||||
sparseIntArray.put(viewsToDrop.get(i), parentsForViewsToDrop.get(i));
|
||||
}
|
||||
mViewsToDrop = sparseIntArray;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -478,8 +484,10 @@ import com.facebook.react.uimanager.UIViewOperationQueue;
|
||||
new SetPadding(reactTag, paddingLeft, paddingTop, paddingRight, paddingBottom));
|
||||
}
|
||||
|
||||
public void enqueueDropViews(SparseIntArray viewsToDrop) {
|
||||
enqueueUIOperation(new DropViews(viewsToDrop));
|
||||
public void enqueueDropViews(
|
||||
ArrayList<Integer> viewsToDrop,
|
||||
ArrayList<Integer> parentsOfViewsToDrop) {
|
||||
enqueueUIOperation(new DropViews(viewsToDrop, parentsOfViewsToDrop));
|
||||
}
|
||||
|
||||
public void enqueueMeasureVirtualView(
|
||||
|
||||
Reference in New Issue
Block a user