Skip to content

Commit 529e528

Browse files
Thomas Nardonefacebook-github-bot
authored andcommitted
Restore subclipping view removal
Summary: With the call to `removeView()` removed from `ReactViewClippingManager` in facebook#47634, we're seeing views erroneously sticking around in the layout. While `removeViewSithSubviewClippingEnabled()` calls `removeViewsInLayout()`, it does not trigger the corresponding side effects of [removeView()](https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-15.0.0_r9/core/java/android/view/ViewGroup.java#5501): ``` public void removeView(View view) { if (removeViewInternal(view)) { --> requestLayout(); --> invalidate(true); } } ``` To compensate, flip `removeViewsInLayout()` to [`removeViews()`](https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-15.0.0_r9/core/java/android/view/ViewGroup.java#5562), which will ensure layout. Changelog: [Android][Fixed] Restore layout/invalidate during ReactViewClippingManager.removeViewAt() Differential Revision: D67398971
1 parent 2ea9a7b commit 529e528

File tree

1 file changed

+1
-1
lines changed
  • packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view

1 file changed

+1
-1
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ public void run() {
748748
clippedSoFar++;
749749
}
750750
}
751-
removeViewsInLayout(index - clippedSoFar, 1);
751+
removeViews(index - clippedSoFar, 1);
752752
}
753753
removeFromArray(index);
754754
}

0 commit comments

Comments
 (0)