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

[Fabric LA] Fix maybeDropAncestors condition. #6663

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bartlomiejbloniarz
Copy link
Contributor

@bartlomiejbloniarz bartlomiejbloniarz commented Nov 4, 2024

Summary

In the maybeDropAncestors function we can remove the view if it has no remaining animating views. Let's say we have nested exiting animations:

flowchart TD
    A((A: EXITING))
    B((B: EXITING))
    C((C: WAITING))
    D((D: WAITING))
    E((E: WAITING))

    A --> B
    A --> C
    A --> D
    A --> E

Loading

In the current implementation in this case if the animation in B ended before A, we would visit A in maybeDropAncestors and decided to remove A, even though it still has some waiting children. Then A would be added to the view recycling pool while still having children. This would cause us to see some zombie views when the view is reused.

I changed the maybeDropAncestors condition to check the size of the children list. I also removed node->animatedChildren as I think it is no longer necessary.

Fixes #6644

Test plan

Chceck [LA] View recycling example, if there are no zombie views in the WheelPicker component.

@bartlomiejbloniarz bartlomiejbloniarz changed the title @bartlomiejbloniarz/fix drop ancestors [Fabric LA] Fix maybeDropAncestors condition. Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

React Native 0.76: Previous Item Remains Visible on State-Driven Navigation
1 participant