airbnb / lottie-web

Render After Effects animations natively on Web, Android and iOS, and React Native. http://airbnb.io/lottie/
MIT License
30.54k stars 2.87k forks source link

Compelete event occurs after the Canvas node is destroyed #2540

Open Lock-And-Key opened 3 years ago

Lock-And-Key commented 3 years ago

Environment Chrome: 90.0.4430.93 lottie-web: 5.7.5

What did you do? Please explain the steps you took before you encountered the problem.

eatAnimalAnimation.addEventListener('complete', () => { doSomething } What did you expect to happen?

I need to do a few things before the DOM is destroyed after the animation has finished playing,but It has a certain probability of the compelete event occurs after the Canvas node is destroyed,I don't know if this is a normal behavior。

What actually happened? Please include as much relevant detail as possible. Randomly

bodymovin commented 3 years ago

hi, how is the canvas node destroyed? Do you have a simple example to test?