-
-
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
The timeline autoplay property overwrites the autoplay property of added animations #894
Comments
If a timeline is the sequence of a number of child animations, unlike all the other properties it only makes sense for autoplay to be global. It's not clear what the expected behavior would even be. If a timeline has a number of both autoplay:true and false children, what happens to the timeline when one of the false children is reached in the sequence? Similarly, it's not clear what should be autoplaying if the timeline is false but some children are true. And for autoplay false children, individual children can't be accessed, so you can't call play() on them, and it's not clear what it means for the whole sequence when one (or multiple) segments within that sequence starts playing. Best fix is probably to adjust the documentation so that this behavior is mentioned, because it's definitely the only sane behavior. |
That works for me as a solution, too. |
Describe the bug
When a standalone animation is created with an
autoplay: false
andduration: 0
, itscomplete
callback is never called. But pass the same properties into a timelineadd
and itscomplete
callback will be called.I believe this is a bug because none of the other properties I tried were overridden by the timeline.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The console should print no output because the animations have
autoplay: false
. You'll notice this is true for the standalone animation at the bottom, but the animations that areadd
ed to the timeline get theircomplete
callback called so it prints output.If you set the timeline's default
autoplay
tofalse
, the example prints nothing, as expected. I.E.:const tl = anime.timeline({ autoplay: false });
does not print anything to the console, so in some situations, this can be used as a workaround.Desktop (please complete the following information):
Using anime.js 3.2.2
The text was updated successfully, but these errors were encountered: