-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Event bindings on animate directive #4547
Labels
Comments
❤️Very much needed! |
Related to #6479 where the opposite is requested |
+1 This is what I'm using to emulate this feature. export function customAnimation(node: Element, ) {
/* function body */
return {
delay, duration, easing, css,
tick: (t, u) => {
if (t === 0) {
node.dispatchEvent(new CustomEvent("animationStart"));
} else if (t === 1) {
node.dispatchEvent(new CustomEvent("animationEnd"));
}
},
};
} |
good day, anyone have a solution for this..? as the above answer is not clear to me.. how can i use this with a flip animation.. kind regards |
I had to hack this. You can basically do what you want by doing a timeout on the duration (assuming your transition duration is setTImeout(() => {
// whatever I want to do
}, 100); J |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would be nice to be able to bind events on the
animate:*
directive, much like the one that are available with the transition directive (introstart
,introend,
outrostart
,outroend
).This feature would be useful in order to prevent other changes to the current component state while an animation is occuring, as a component update during an animation can make it glitch.
I think two events named
animstart
andanimend
would be appropriate.In the meantime, is there a way to emulate this feature with what svelte already offers ?
The text was updated successfully, but these errors were encountered: