-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Reverse on animation is broken in anime js 3 #577
Comments
I also have such problems. |
Also experienced this problem. What I did is used the CDN on version 2.2.0 |
Julian on a long vacation?) No activities for the last 5+ months... |
hi.
how can help you?
…On Wed, Jun 19, 2019 at 9:34 AM Eugene Kopich ***@***.***> wrote:
Julian on a long vacation?) No activities for the last 5+ months...
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#577?email_source=notifications&email_token=AKWCZ5LDE7JH4YAKKLHLKHTP3HOQJA5CNFSM4HRESMM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYA7DQI#issuecomment-503443905>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKWCZ5LNY6CBI7BKCJAMWF3P3HOQJANCNFSM4HRESMMQ>
.
|
Also experiencing this issue. |
@StephenStrickland new version 3.1.0 was released yesterday, have you tried it? It should be fixed... |
@web2033 can still reproduce the issue with @sven-ra's code on 3.1.0, third click flickers. https://codesandbox.io/s/testwith3-1-rfi9r |
Yeah flickers, I thought it was related to this fix #546 |
@web2033 yeah, problem still exists in 3.1.0. I also thought that #546 would fix it, but apparently it didn't. |
Can confirm, still not working, @juliangarnier, @web2033 any possibility in the next version to be fixed? :( |
This is currently blocking my project, I attempted a downgrade to 2.1 but there's some behavior changes that doesn't make it easy to downgrade (relative sizing for width/height animations). So I'm kinda stuck with v3.x. Is there any way that I can assist in triaging this issue? |
Maybe, any of us can find the issue and do a PR? I do not know... |
The workaround I've found is to use an "in/out" animations. I use the "in" animation and then when I'm ready to reverse the animation I use the "out" animation. I destroy the animations between. Basically, I skip using reverse() altogether. Once I abandoned reverse() life got much easier. Simple example:
|
I'm also experiencing this problem. My solution was something like @buwilliams suggested, but that leads to a lot of boilerplate code. |
I encountered this issue today, here is my solution as a pen. I think the confusion arises from when animations are paused, and how the
Doing |
@slavanossar Has the correct answer. In order to reverse an animation, and then play it back from the end, the following must be done:
|
I managed to use reverse() on a timeline after I followed @slavanossar 's advice, but I still have my background flicker for a millisecond, which is unacceptable and very obvious since I'm toggling from black to white. Weirdly enough, on codepen same code doesn't flicker, but here my custom timeline delays don't work (that second parameter in .add({}, "-=500")). Any suggestions? |
I have the same problem as @m-eton . I manage to use reverse() on a timeline, but I still have my translate flicker for a milisecond, which is unacceptable and very obvious since I am moving a div from point B to point A (the reversed) and for a milisecond the div travels to A and back to B, and then animate smoothly to A. Plus it only happens when running the reversed timeline (B to A) and not the original (A to B). Any suggestions? seems like its aplying the original styles and then recalculting |
Taking a closer look, I need to make this change, In order to make the reverse work as expected. Commenting the reset if completed section
|
I also just experienced this issue when using a timeline, instead of the single animation instance used in my solution. The problem is caused by this line. An explanation of what happens at the end of a timeline animation when my solution is used:
The problem starts in the toggleInstanceDirection method, which is called in function toggleInstanceDirection() {
var direction = instance.direction;
if (direction !== 'alternate') {
instance.direction = direction !== 'normal' ? 'normal' : 'reverse';
if (instance.progress === 100 && instance.direction === 'reverse') {
instance.completed = false;
}
}
...
} I've updated my pen with code that should work for both single animations and timelines. |
This should be fixed in v3.2.0 |
This was the solution that made it for me. Much appreciated! |
When I try to make a togglable animation like togglable menu for example the animation controls don't work as intended after the first time. When I click for reversed animation, it instead snaps to the beginning and plays it from the start again. Or there might be some other strange behaviour. This used to work in 2.2.
https://codepen.io/www_sven/pen/OYBaGw Anime JS 3.0.1
https://codepen.io/www_sven/pen/VOEVJz Anime JS 2.2.0 -> Works as expected
Steps to reproduce:
The text was updated successfully, but these errors were encountered: