fix(angular): swipe to go backs in tabs (#16710)

This commit is contained in:
Manu MA
2018-12-12 17:49:51 +01:00
committed by GitHub
parent b6fd440d34
commit 2553820f78
4 changed files with 9 additions and 9 deletions

View File

@@ -22,7 +22,6 @@ export class IonRouterOutlet implements OnDestroy, OnInit {
private name: string;
private stackCtrl: StackController;
private nativeEl: HTMLIonRouterOutletElement;
private hasStack = false;
tabsPrefix: string | undefined;
@@ -38,7 +37,7 @@ export class IonRouterOutlet implements OnDestroy, OnInit {
set swipeGesture(swipe: boolean) {
this._swipeGesture = swipe;
this.nativeEl.swipeHandler = (swipe && this.hasStack) ? {
this.nativeEl.swipeHandler = swipe ? {
canStart: () => this.stackCtrl.canGoBack(1),
onStart: () => this.stackCtrl.startBackTransition(),
onEnd: shouldContinue => this.stackCtrl.endBackTransition(shouldContinue)
@@ -87,7 +86,7 @@ export class IonRouterOutlet implements OnDestroy, OnInit {
}
this.nativeEl.componentOnReady().then(() => {
if (this._swipeGesture === undefined) {
this.swipeGesture = this.config.get('swipeBackEnabled', this.nativeEl.mode === 'ios');
this.swipeGesture = this.config.getBoolean('swipeBackEnabled', this.nativeEl.mode === 'ios');
}
});
}

View File

@@ -66,7 +66,7 @@ export class StackController {
});
}
startBackTransition(stackId?: string) {
startBackTransition(stackId = this.getActiveStackId()) {
const views = this.getStack(stackId);
this.transition(
views[views.length - 2], // entering view