Skip to content

Commit 0683206

Browse files
Thomas Nardonefacebook-github-bot
authored andcommitted
Restore subclipping view removal (#48329)
Summary: Pull Request resolved: #48329 With the call to `removeView()` removed from `ReactViewClippingManager` in #47634, we're seeing views erroneously sticking around in the layout. While `removeViewWithSubviewClippingEnabled()` 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() Reviewed By: javache Differential Revision: D67398971 fbshipit-source-id: b100db468cc3be6ddc6edd6c6d078a8a0b59a2c1
1 parent a9f60be commit 0683206

File tree

1 file changed

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

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,7 @@ public void run() {
749749
}
750750
}
751751
removeViewsInLayout(index - clippedSoFar, 1);
752+
invalidate();
752753
}
753754
removeFromArray(index);
754755
}

0 commit comments

Comments
 (0)