juliangarnier / anime

JavaScript animation engine
https://animejs.com
MIT License
50.42k stars 3.68k forks source link

The begin function is not called when duration is 0. #893

Open DanKaplanSES opened 6 months ago

DanKaplanSES commented 6 months ago

Describe the bug The begin function is not called when duration is 0. The documentation says it should be:

Both begin() and complete() callbacks are called if the animation's duration is 0.

To Reproduce Steps to reproduce the behavior:

  1. Load this codepen.io: https://codepen.io/Daniel-Kaplan/pen/RwOXrrJ?editors=1111
  2. Read the console

Expected behavior The console should print "Begin" 0-"Begin" 3 and "standalone begin". It only prints "complete" logs.

If you change the duration to > 0, it prints as expected.

Desktop (please complete the following information):

Using anime.js 3.2.2