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

transitionEnd should not be applied when new animations caused the animation to stop #2265

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

Conversation

chuganzy
Copy link
Contributor

@chuganzy chuganzy commented Jul 29, 2023

This PR aims to fix an issue where transitionEnd styles are applied after new animation starts and accidentally overrides the latest motion values.

When new animation starts while animating, MotionValue stops the ongoing animation and immediately starts the new one. However as transitionEnd waits for all animations to be resolved, some transitionEnd styles overrides new values.

It seems to be introduced in #2025. Before it lands, calling stop() never resolves animation Promises, which are used to apply the transitionEnd styles at the end, so there was no race condition..

Closes: chakra-ui/chakra-ui#7775

@mattgperry
Copy link
Collaborator

Can you add a test for this behaviour? It also looks like this would stop all of transitionEnd values being applied if even any one of the values is animating.

@chuganzy
Copy link
Contributor Author

chuganzy commented Aug 5, 2023

@mattgperry Sure, added a test and fixed the logic to check if animations completed vs canceled here

@jonahallibone
Copy link

Any update on this PR? I believe I am experiencing the issue this PR would fix

@stefanweck
Copy link

This fix would resolve #2317. Any update on merging this fix?

@jonahallibone
Copy link

Bumping this, any update Framer team?

@AndreiRailean
Copy link

Hey @mattgperry what do you think needs to happen to get this PR merged?
I assume at a minimum it needs to be brought up-to-date with master. Is there anything else?

@TranslucentDragon
Copy link

Would like to bump this as well. I came here from the earlier linked accordion chakra UI issue. What else needs to happen to get this merged? @mattgperry

@jonahallibone
Copy link

It seems like this isn't a problem in the newest versions of framer motion. I haven't noticed it in in the most recent couple versions. Can anyone else confirm?

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.

Accordion doesn't open if you click it multipe times fast enough, and it loses track of state.
6 participants