Skip to content

Commit a3a095d

Browse files
committed
swipe back gesture no longer gets stuck on vue
1 parent d598035 commit a3a095d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

core/src/components/router-outlet/route-outlet.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export class RouterOutlet implements ComponentInterface, NavOutlet {
2020
private gesture?: Gesture;
2121
private ani?: Animation;
2222
private animationEnabled = true;
23+
private isTransitioning = false;
2324

2425
@Element() el!: HTMLElement;
2526

@@ -63,7 +64,7 @@ export class RouterOutlet implements ComponentInterface, NavOutlet {
6364
async connectedCallback() {
6465
this.gesture = (await import('../../utils/gesture/swipe-back')).createSwipeBackGesture(
6566
this.el,
66-
() => !!this.swipeHandler && this.swipeHandler.canStart() && this.animationEnabled,
67+
() => !this.isTransitioning && !!this.swipeHandler && this.swipeHandler.canStart() && this.animationEnabled,
6768
() => this.swipeHandler && this.swipeHandler.onStart(),
6869
step => this.ani && this.ani.progressStep(step),
6970
(shouldComplete, step, dur) => {
@@ -184,6 +185,8 @@ export class RouterOutlet implements ComponentInterface, NavOutlet {
184185
const animated = this.animated && config.getBoolean('animated', true);
185186
const animationBuilder = this.animation || opts.animationBuilder || config.get('navAnimation');
186187

188+
this.isTransitioning = true;
189+
187190
await transition({
188191
mode,
189192
animated,
@@ -198,6 +201,8 @@ export class RouterOutlet implements ComponentInterface, NavOutlet {
198201
animationBuilder,
199202
});
200203

204+
this.isTransitioning = false;
205+
201206
// emit nav changed event
202207
this.ionNavDidChange.emit();
203208

0 commit comments

Comments
 (0)