Skip to content

bug: (angular) gesture partial back #18462

@Kadinvanvalin

Description

@Kadinvanvalin

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions