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
If a user chooses to update the keyframes in an onFinish callback this can cause the direction to be incorrect because we force the duration to either normal or reverse for progressEnd. This forced value allows us to play the animation to either the beginning or the end when a gesture ends (for example, the card modal can either be swiped to close or swipe and then bounce back to its opened state). We clear that forced value, but since the callback that does so runs after the user callback, it's possible to get a stale direction state.
Expected Behavior
I expect any internal value coercions to be reset when the animation ends before any user code runs.
Drag the card along the track and then release it. The card will animation back to the beginning and then update its keyframes to animate the background from green to red.
Observe that when we call progressStart(true, 0) this jumps the animation back to the beginning. However, since the animation's direction is still forced to "reverse" the card shows red since that keyframe is technically the first keyframe now.
Observe that calling progressStart again after a delay (see the setTimeout) the animation correctly jumps to the green keyframe since the coerced direction has been reset.
Prerequisites
Ionic Framework Version
v6.x, v7.x
Current Behavior
The internal
onFinishcallback set at the end of a gesture inprogressEndcan incorrectly fire after useronFinishcallbacks fire: https://github.com/ionic-team/ionic-framework/blob/331c08aad542de158e53ed351705d4c396bb4e90/core/src/utils/animation/animation.ts#L830C4-L837If a user chooses to update the keyframes in an
onFinishcallback this can cause the direction to be incorrect because we force the duration to either normal or reverse forprogressEnd. This forced value allows us to play the animation to either the beginning or the end when a gesture ends (for example, the card modal can either be swiped to close or swipe and then bounce back to its opened state). We clear that forced value, but since the callback that does so runs after the user callback, it's possible to get a stale direction state.Expected Behavior
I expect any internal value coercions to be reset when the animation ends before any user code runs.
Steps to Reproduce
onFinishcallback fires the direction is registered as "reverse" but it is registered as "normal" if run in asetTimeout.The negative impact this has can be seen in the following reproduction:
progressStart(true, 0)this jumps the animation back to the beginning. However, since the animation's direction is still forced to "reverse" the card shows red since that keyframe is technically the first keyframe now.progressStartagain after a delay (see thesetTimeout) the animation correctly jumps to the green keyframe since the coerced direction has been reset.Screen.Recording.2023-10-20.at.4.24.30.PM.mov
Code Reproduction URL
No response
Ionic Info
N/A
Additional Information
No response