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

Timing problem with leave-animations #714

Open
jwstegemann opened this issue Nov 3, 2022 · 3 comments
Open

Timing problem with leave-animations #714

jwstegemann opened this issue Nov 3, 2022 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jwstegemann
Copy link
Owner

Leave animations can cause problems when the next patch(es) for a mount-point are applied before the animation is completed. This is because the patches work on indices of child-elements. When the dom-elements of animated tags are still there when the next patch is applied the indices calculated by the diff are not correct. The effect is, that some dom-nodes corresponding to removed elements are never deleted.

Possible solution:

Tag elements with a running leave-animation (for example by data-leaving) and do not count them in anymore, when patches are applied.

@jwstegemann jwstegemann added the bug Something isn't working label Nov 3, 2022
@jwstegemann jwstegemann added this to the 1.0-RC3 milestone Nov 3, 2022
@jwstegemann jwstegemann self-assigned this Nov 3, 2022
@ghost ghost modified the milestones: 1.0-RC3, 1.0-RC4 Nov 23, 2022
@jwstegemann
Copy link
Owner Author

Just a thought: Wouldn't it be better to wait for running animations to finish on the mount-point before we request a new value from the flow. This way we might to save a not necessary run of the Myer-diff. Or would this block other things?
What do you think, @jamowei and @chausknecht ?

@ghost ghost modified the milestones: 1.0-RC4, 1.0-RC5 Mar 1, 2023
@ghost ghost modified the milestones: 1.0-RC5, 1-0-RC6 May 8, 2023
@Lysander Lysander removed this from the 1-0-RC6 milestone Jun 20, 2023
@Lysander Lysander added this to the 1.0-RC12 milestone Sep 14, 2023
@Lysander
Copy link
Collaborator

It is quite reasonable, that this issue is allready fixed by PR #795 - we should investigate and then close this one.

@Lysander Lysander modified the milestones: 1.0-RC12, 1.0-RC13 Oct 23, 2023
@Lysander
Copy link
Collaborator

Lysander commented Jan 2, 2024

This is still a problem - this can be easily verfied with animations in toasts. Just enable the following uncommented animation code:

// headless-demo: toast.kt, L 108
        /*transition(
            enter = "transition-all duration-200 ease-in-out",
            enterStart = "opacity-0",
            enterEnd = "opacity-100",
            leave = "transition-all duration-200 ease-in-out",
            leaveStart = "opacity-100",
            leaveEnd = "opacity-0"
        )*/

@Lysander Lysander modified the milestones: 1.0-RC13, 1.0 Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants