Skip to content

Commit

Permalink
Restore subclipping view removal
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Thomas Nardone authored and facebook-github-bot committed Dec 18, 2024
1 parent 2ea9a7b commit 529e528
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ public void run() {
clippedSoFar++;
}
}
removeViewsInLayout(index - clippedSoFar, 1);
removeViews(index - clippedSoFar, 1);
}
removeFromArray(index);
}
Expand Down

0 comments on commit 529e528

Please sign in to comment.