-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Add conditional return in handleRemoveView
#43389
Add conditional return in handleRemoveView
#43389
Conversation
Does this issue only affect the old architecture or does it repro on the new arch too? (zonder is handled differently there) |
Base commit: 1ea269f |
I tested it only on the old architecture, but I think this issue should only be present there. |
...es/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java
Show resolved
Hide resolved
Hey @bartlomiejbloniarz, thanks for submitting this! 🙂 I was just trying to repro on a physical Android device using
![]()
NOTE: the Do you happen to have a branch where you added an exemple in |
Hi @fabriziocucci. There might have been a small miscommunication on my part. I tested the code from the snack only within our ReanimatedExampleApp. Then I applied those changes in the forked After some testing I think the issue that you are seeing is caused by the fact that our compatibility with bridgeless is still work in progress, so using reanmiated in the |
@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: This appears to fix an issue where removing a sibling with zIndex breaks drawing of the next sibling. The theory is that eager return in `onViewRemoved` prevents the view from reverting into a state where it no longer uses custom draw order. However, tracing back history, this eager return was [added](facebook#43389) to fix a bug in Reanimated. cc bartlomiejbloniarz to confirm if [this Reanimated issue](software-mansion/react-native-reanimated#5715) resurfaces from this change. Fixes facebook#49838 ## Changelog [Android][Fixed] Fixes issue with z-indexed sibling removal Differential Revision: D70795631
Summary: Pull Request resolved: #49900 This appears to fix an issue where removing a sibling with zIndex breaks drawing of the next sibling. The theory is that eager return in `onViewRemoved` prevents the view from reverting into a state where it no longer uses custom draw order. However, tracing back history, this eager return was [added](#43389) to fix a bug in Reanimated. cc bartlomiejbloniarz to confirm if [this Reanimated issue](software-mansion/react-native-reanimated#5715) resurfaces from this change. Fixes #49838 ## Changelog [Android][Fixed] Fixes issue with z-indexed sibling removal Reviewed By: NickGerleman, cipolleschi Differential Revision: D70795631 fbshipit-source-id: 500af92226be29af73f36f911ffff27a0c083ae9
Summary: Pull Request resolved: #49900 This appears to fix an issue where removing a sibling with zIndex breaks drawing of the next sibling. The theory is that eager return in `onViewRemoved` prevents the view from reverting into a state where it no longer uses custom draw order. However, tracing back history, this eager return was [added](#43389) to fix a bug in Reanimated. cc bartlomiejbloniarz to confirm if [this Reanimated issue](software-mansion/react-native-reanimated#5715) resurfaces from this change. Fixes #49838 ## Changelog [Android][Fixed] Fixes issue with z-indexed sibling removal Reviewed By: NickGerleman, cipolleschi Differential Revision: D70795631 fbshipit-source-id: 500af92226be29af73f36f911ffff27a0c083ae9
Summary:
I was recently working on an issue in Reanimated where z-index of some views was broken after a Layout Animation was used. The issue was that in some cases we were calling the
removeView
function on a already removed view. On plain Android this wouldn't be an issue, since theremoveView
function ignores such calls. Unfortunately, theReactViewGroup.java
implementation maintains a counter of views with user defined z-index. This counter is decremented whenever a call toremoveView
is made, even if the view is not a child of thisViewGroup
. This PR adds an additional check in thehandleRemoveView
function to unify theremoveView
behavior between Android and react-native.Changelog:
[ANDROID] [CHANGED] - Changed the
handleRemoveView
function inReactViewGroup.java
to ignore calls forViews
that are not children of thisViewGroup
Test Plan:
I tested if the
rn-tester
app behaves correctly after those changes.