fix(ios): hide leaving view after nav transition to avoid flicker (#19691)

fixes #19674
This commit is contained in:
Liam DeBeasi
2019-10-18 10:08:42 -04:00
committed by GitHub
parent e3233000c6
commit e6e01381eb
3 changed files with 22 additions and 15 deletions

View File

@ -1,6 +1,6 @@
import { Animation } from '../../interface';
import { createAnimation } from '../animation/animation';
import { TransitionOptions } from '../transition';
import { TransitionOptions, getIonPageElement } from '../transition';
const DURATION = 540;
const addSafeArea = (val: number, side = 'top'): string => {
@ -376,6 +376,13 @@ export const iosTransitionAnimation = (navEl: HTMLElement, opts: TransitionOptio
.beforeClearStyles([OPACITY])
.fromTo('transform', `translateX(${CENTER})`, (isRTL ? 'translateX(-100%)' : 'translateX(100%)'));
const leavingPage = getIonPageElement(leavingEl) as HTMLElement;
rootAnimation.afterAddWrite(() => {
if (rootAnimation.getDirection() === 'normal') {
leavingPage.style.setProperty('display', 'none');
}
});
} else {
// leaving content, forward direction
leavingContent