chenglou / chenglou/react-motion
How to force finish animations or cancel the default reverse behavior?
- Dominant language
- JavaScript
- Stars
- 21.9k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
I have an onboarding slideshow. Clicking a "Continue" button triggers a new slide to slide in from the right. The old slide will slide out to the left.
This works fine as long as I don't click faster than the animation-time. If I click faster then new slides will appear from the left instead of the right because the previous animation wasn't finished.
How can I cancel/disable this reverse-animation behavior?
Expected/desired behavior: Clicking fast will just immediately finish the previous animation and not mess with the next one.
P.S. I should add that i'm animating route transitions with TransitionMotion and can't use `onRest`
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the rapid-click behavior with TransitionMotion during route transitions. Read the TransitionMotion animation and interruption behavior in the project documentation and source, then determine how an in-progress animation can be finished or canceled. Done means repeated clicks consistently make each new slide enter from the right without relying on onRest.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100