Skip to content
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

[web-animations-2] Should ‘state’ triggers cancel() their animation(s) outside the exit range if the animation finished? #11915

Open
DavMila opened this issue Mar 11, 2025 · 0 comments

Comments

@DavMila
Copy link
Contributor

DavMila commented Mar 11, 2025

state animation triggers play or resume their related animation when within their trigger range and pause them when outside their exit range. If, after being played, the animation finishes prior to the trigger’s exit condition being met (being outside the exit range), should state triggers reset the animation when the exit condition is met?

Resetting the animation allows the trigger to naturally restart the animation the next time its trigger condition is met, making it a special case of a repeat trigger.

Not resetting the animation means after it finishes, subsequently meeting the trigger condition won’t replay the animation, making it a special case of a once trigger.

I propose not resetting the animation after it finishes. If an author would like a state trigger to restart after “finishing” they can specify animation-iteration-count: infinite.
OTOH, if we specify that the exit condition resets a finished animation, and the author does not want the animation to restart, they can simply nuke the trigger, i.e. animation.trigger = null.. Though this feels less clean IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant