Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix subclipping view removal #48329

Closed
wants to merge 1 commit into from
Closed

Conversation

tdn120
Copy link

@tdn120 tdn120 commented Dec 18, 2024

Summary:
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():

public void removeView(View view) {
  if (removeViewInternal(view)) {
--> requestLayout();
--> invalidate(true);
  }
}

To compensate, add an invalidate() after removeViewsInLayout().

Changelog: [Android][Fixed] Restore layout/invalidate during ReactViewClippingManager.removeViewAt()

Differential Revision: D67398971

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 18, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67398971

@tdn120
Copy link
Author

tdn120 commented Dec 18, 2024

Heads up to @kkafar

Summary:

With the call to `removeView()` removed from `ReactViewClippingManager` in facebook#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
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67398971

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Dec 19, 2024
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 0683206.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by Thomas Nardone in 0683206

When will my fix make it into a release? | How to file a pick request?

@kkafar
Copy link
Contributor

kkafar commented Dec 20, 2024

Thanks!

@tdn120 tdn120 changed the title Restore subclipping view removal Fix subclipping view removal Dec 20, 2024
robhogan pushed a commit that referenced this pull request Dec 23, 2024
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
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by Thomas Nardone in e3970a4

When will my fix make it into a release? | How to file a pick request?

cipolleschi pushed a commit that referenced this pull request Jan 8, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants