mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
ReactViewGroup - use safer removeViewInLayout (#45980)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/45980 Use a safe remove method that won't crash on IndexOutOfBounds. Changelog: [Internal] Reviewed By: javache Differential Revision: D61132496 fbshipit-source-id: edd887611c47f236b495986fc29e2d0b9ce56b8e
This commit is contained in:
committed by
Facebook GitHub Bot
parent
26aff664c0
commit
49fa92e016
+1
-1
@@ -466,7 +466,7 @@ public class ReactViewGroup extends ViewGroup
|
||||
if (!intersects && child.getParent() != null && !isAnimating) {
|
||||
// We can try saving on invalidate call here as the view that we remove is out of visible area
|
||||
// therefore invalidation is not necessary.
|
||||
removeViewsInLayout(idx - clippedSoFar, 1);
|
||||
removeViewInLayout(child);
|
||||
needUpdateClippingRecursive = true;
|
||||
} else if (intersects && child.getParent() == null) {
|
||||
addViewInLayout(child, idx - clippedSoFar, sDefaultLayoutParam, true);
|
||||
|
||||
Reference in New Issue
Block a user