You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In some situation I need to stop animating an element from running animation and remove all animation effects. Make it look like the animation never ran.
I see that motion does style persistence automatically internally. But the cancel interface only calls the WAAPI interface without deleting the style.
Describe the solution you'd like
I want the cancel interface
Ability to remove internally set styles together.
Alternatively, use the style override of the initial state.
Describe alternatives you've considered
Another solution is that the stop interface no longer checks the value of time, so I can achieve the goal by setting time = 0 and then calling the stop interface.
I have an issue that is somewhat similar. In version 10 with motion, when I used currentTime=0 and pause() it would commit the initial look to the screen. With 11 it does not. I can't replicate that behavior. And cancel() behaves weirdly where it messes up how animation is executed.
Is your feature request related to a problem? Please describe.
In some situation I need to stop animating an element from running animation and remove all animation effects. Make it look like the animation never ran.
I see that
motion
does style persistence automatically internally. But thecancel
interface only calls the WAAPI interface without deleting the style.motion/packages/framer-motion/src/animation/animators/AcceleratedAnimation.ts
Lines 418 to 422 in ecd97f7
Describe the solution you'd like
I want the
cancel
interfaceDescribe alternatives you've considered
Another solution is that the
stop
interface no longer checks the value oftime
, so I can achieve the goal by settingtime = 0
and then calling thestop
interface.motion/packages/framer-motion/src/animation/animators/AcceleratedAnimation.ts
Line 383 in ecd97f7
Additional context
My temporary solution was to manually remove the style on the element using
element.style.cssText = ''
.The text was updated successfully, but these errors were encountered: