mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
fix(nav): prevent completing transition from being interrupted (#19113)
* do not enable swipe to begin before previous one has ended * update defaults * use canStart instead * pause animations on finish * remove old pause code
This commit is contained in:
@ -604,7 +604,7 @@ export const createAnimation = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const initializeCSSAnimation = () => {
|
||||
const initializeCSSAnimation = (toggleAnimationName = true) => {
|
||||
cleanUpStyleSheets();
|
||||
|
||||
elements.forEach(element => {
|
||||
@ -628,7 +628,10 @@ export const createAnimation = () => {
|
||||
setStyleProperty(element, 'animation-iteration-count', iterationsCount);
|
||||
setStyleProperty(element, 'animation-play-state', 'paused');
|
||||
|
||||
setStyleProperty(element, 'animation-name', `${stylesheet.id}-alt`);
|
||||
if (toggleAnimationName) {
|
||||
setStyleProperty(element, 'animation-name', `${stylesheet.id}-alt`);
|
||||
}
|
||||
|
||||
requestAnimationFrame(() => {
|
||||
setStyleProperty(element, 'animation-name', stylesheet.id || null);
|
||||
});
|
||||
@ -660,14 +663,14 @@ export const createAnimation = () => {
|
||||
|
||||
};
|
||||
|
||||
const initializeAnimation = () => {
|
||||
const initializeAnimation = (toggleAnimationName = true) => {
|
||||
beforeAnimation();
|
||||
|
||||
if (_keyframes.length > 0) {
|
||||
if (supportsWebAnimations) {
|
||||
initializeWebAnimation();
|
||||
} else {
|
||||
initializeCSSAnimation();
|
||||
initializeCSSAnimation(toggleAnimationName);
|
||||
}
|
||||
}
|
||||
|
||||
@ -968,7 +971,7 @@ export const createAnimation = () => {
|
||||
*/
|
||||
const play = () => {
|
||||
if (!initialized) {
|
||||
initializeAnimation();
|
||||
initializeAnimation(false);
|
||||
}
|
||||
|
||||
if (finished) {
|
||||
|
Reference in New Issue
Block a user