Animation plays itself when a state changes
See original GitHub issueDo you want to request a feature or report a bug?
Bug
What is the current behavior?
First I’m rendering an animation with autoplay set to false.
this.options = { loop: false, autoplay: false, animationData: require("./leo_anim.json"), rendererSettings: { preserveAspectRatio: "xMidYMid slice" } };
The animation does not start which is perfect, but then I call setState()
function and the animation starts playing
See the behavior here: https://codesandbox.io/s/2wk6nv3pvr
What is the expected behavior?
If the animation has autoplay set to false, then it should only start when the play function is called.
Which versions of Lottie
Both “react-lottie”: “1.0.0” & “react-lottie”: “1.1.0”
Thank you for your help!
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
animation-play-state - CSS: Cascading Style Sheets | MDN
The animation-play-state CSS property sets whether an animation is running or paused.
Read more >PowerPoint plays animations automatically even with start on ...
Hi guys, I'm facing a weird problem with PowerPoint. I have some animations applied in one of my slides, some are set to...
Read more >Growing game animation: State changes and pathing
State changes A state change is when a character changes from one set of animations to another by some sort of trigger. These...
Read more >Animation Trigger playing twice - Unity Answers
try setting the transition duration to 0 on the line leading to your animation and see if that works. with short animations it...
Read more >[Unity] - Animation not playing when using any state state in ...
Not my style of videos for this channel but I wanted to share this as it seems like this is common misconception and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, I think that is a bug to be fixed. I’ll handle the logic in the wrapper.
Thanks for issuing this 😃
There’s another problem when setting
isStopped
totrue
. Now, when a state changes, the animation stops playing.See: https://codesandbox.io/s/xjr104920p
The play button should start the animation on the bottom but, because it also changes a state and the animation has
isStopped
set totrue
, the animation stops immediately after playing. Contrary to what happens with the top animation that hasisStopped
set tofalse
. Even though I never play this animation, it starts because the state changed