question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: (angular) gesture partial back

See original GitHub issue

Bug 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:

  1. From the home view, tap on push me button
  2. Drag your finger from left to right, stopping in the middle of the screen
  3. 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:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
dansiemenscommented, Jul 5, 2019

@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.

2reactions
AndreasGassmanncommented, Jun 14, 2019

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:

  • The sub-page becomes transparent, showing the parent page.
  • “Scrolling” gets applied to the parent page, the sub-page does not move
  • We have a drawing are on the sub-page, touch events still get registered there, but they also scroll the parent page.
  • Using swipe-back fixes the issue (by going back to the parent page).

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found