bug: (angular) gesture partial back
See original GitHub issueBug Report
Ionic version:
[x] 4.x
Current behavior: When viewing a Detail view you can swipe back to return to the List view you came from. However if you only drag your finger partially across the screen and return back to the Detail view without removing your finger, the view begins to behave strangely. The List view is now visible. Expected behavior: If you start to swipe right to back out of a view and gesture back to pull the page back into view. The previous page should be hidden
Steps to reproduce:
- From the home view, tap on push me button
- Drag your finger from left to right, stopping in the middle of the screen
- Without removing your finger, drag your finger back to the left which will return you to the “other” page Related code: https://github.com/Kadinvanvalin/ionic-gesture-back
// stack-controller.ts
// I was able to fix locally by adding the else statement.
endBackTransition(shouldComplete: boolean) {
if (shouldComplete) {
this.skipTransition = true;
this.pop(1);
} else {
const leavingView = this.activeView;
const viewsSnapshot = this.views.slice();
if (leavingView) { cleanupAsync(leavingView, this.views, viewsSnapshot, this.location); }
}
}
Other information:
.ion-page-hidden is removed when you start the gesture, but isn’t reapplied at the end of the gesture if you end on the “wrong page” Ionic info:
Ionic:
ionic (Ionic CLI) : 4.3.1 (/Users/kadin/.nvm/versions/node/v11.1.0/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.4.2
@angular-devkit/build-angular : 0.13.9
@angular-devkit/schematics : 7.3.9
@angular/cli : 7.3.9
@ionic/angular-toolkit : 1.5.1
System:
NodeJS : v11.1.0 (/Users/kadin/.nvm/versions/node/v11.1.0/bin/node)
npm : 6.9.0
OS : macOS
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:16 (6 by maintainers)
Top Results From Across the Web
bug: (angular) gesture partial back · Issue #18462 · ionic-team ...
Current behavior: When viewing a Detail view you can swipe back to return to the List view you came from. However if you...
Read more >NativeScript Angular 2 disable swipe back on ios
This means that the user will not be able to go back using the back button (or swipe back in iOS). This is...
Read more >Gestures in an Angular Application - InDepth.Dev
In this post I will attempt to explain how to use hammerjs gesture recognizers provided by the @angular/platform-browser package.
Read more >Swipeback Gesture Configuration in Ionic 4 - Damir's Corner
I want my swipe back gesture to custom functionality, instead of just routing back. I can control android back button but cannot handle...
Read more >Angular 5 and ASP.NET Core - Toptal
NET's front-end tools may be lacking, it is still a great back-end framework. In this article, Toptal Freelance Angular Developer Pablo Albella teaches...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@joshstrange seems overkill…better solution would be to just reapply
.ion-page-hidden
at the end of the gesture as @Kadinvanvalin suggested in the bug report.I can confirm this issue. In my case, I am using the
cordova-plugin-camera-preview
plugin on a subpage and have to make the whole content transparent. Everything works fine until I use swipe to go back.The behaviour is very weird:
We are currently migrating our app to Ionic 4 and this branch is not public yet. But if it would help you in reproducing the error, I can try to make it public.
Here is a video: https://streamable.com/tt8p9
EDIT: My temporary solution is to simply disable swipe to go back in the whole application. Ideally I would like to only disable it on some pages, but I couldn’t find any docs for it. Is there a way to do that?