fix(tabs): fix goto root (#16926)

fixes #16917
This commit is contained in:
Manu MA
2019-01-01 17:51:38 +01:00
committed by GitHub
parent cda2573fdd
commit 8ee9205629
3 changed files with 32 additions and 36 deletions

View File

@ -64,6 +64,9 @@ export class IonTabs {
? href
: this.outlet.getLastUrl(tab) || href;
return this.navCtrl.navigateBack(url);
return this.navCtrl.navigateRoot(url, {
animated: true,
animationDirection: 'back'
});
}
}

View File

@ -44,25 +44,20 @@ export class NavController {
navigateForward(url: string | UrlTree | any[], options: NavigationOptions = {}) {
this.setDirection('forward', options.animated, options.animationDirection);
if (Array.isArray(url)) {
return this.router!.navigate(url, options);
} else {
return this.router!.navigateByUrl(url, options);
}
this.navigate(url, options);
}
navigateBack(url: string | UrlTree | any[], options: NavigationOptions = {}) {
this.setDirection('back', options.animated, options.animationDirection);
// extras = { replaceUrl: true, ...extras };
if (Array.isArray(url)) {
return this.router!.navigate(url, options);
} else {
return this.router!.navigateByUrl(url, options);
}
this.navigate(url, options);
}
navigateRoot(url: string | UrlTree | any[], options: NavigationOptions = {}) {
this.setDirection('root', options.animated, options.animationDirection);
this.navigate(url, options);
}
navigate(url: string | UrlTree | any[], options: NavigationOptions) {
if (Array.isArray(url)) {
return this.router!.navigate(url, options);
} else {

View File

@ -139,8 +139,7 @@ async function overlayAnimation(
overlay.animation.destroy();
overlay.animation = undefined;
return false;
} else {
}
// Make overlay visible in case it's hidden
baseEl.classList.remove('overlay-hidden');
@ -163,7 +162,6 @@ async function overlayAnimation(
animation.destroy();
overlay.animation = undefined;
return hasCompleted;
}
}
export function autoFocus(containerEl: HTMLElement): HTMLElement | undefined {