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.

Swipe back gesture on iOS and NavController.setPages doesn't scroll correctly

See original GitHub issue

Short description of the problem:

If I will set navigation stack through NavController.setPages and then I use gesture for getting back on iOS there is problem with scrolling. After swiping back is not possible to scroll to the top of the page.

image

You can see it in following video: https://dl.dropboxusercontent.com/u/25736835/swipe-back-scroll-problem.mp4

Steps to reproduce:

  1. Create two pages - E. g. Home and Detail.
  2. Implement some logic home.html
<button (click)="showDetail()">Detail page</button>

home.ts

showDetail(){
  this.navController.setPages([
    {page: HomePage},
    {page: DetailPage}
  ], {
    animate: true,
    direction: 'forward'
  });
}
  1. Try swipe back on iOS device (back button works correctly)

Ionic info

Ionic version in project: 2.0.0-beta.10

System information

Cordova CLI: 6.1.1 Gulp version: CLI version 3.8.11 Gulp local: Local version 3.9.1 Ionic Framework Version: 2.0.0-beta.10 Ionic CLI Version: 2.0.0-beta.32 Ionic App Lib Version: 2.0.0-beta.18 ios-deploy version: 1.8.4 ios-sim version: 3.1.1 OS: Mac OS X El Capitan Node Version: v5.0.0 Xcode version: Xcode 7.3 Build version 7D175

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
danielryscommented, Oct 26, 2016

Workaround using remove() instead of setPages() seems to do the right thing for me.

     this.nav.push(DetailPage).then(() => {
        this.nav.remove(1); // remove the page from stack instead of using setPages and leaving it out
      });
0reactions
ionitron-bot[bot]commented, Mar 26, 2018

Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Thank you for using Ionic!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Swipe back gesture on iOS and NavController.setPages ...
If I will set navigation stack through NavController.setPages and then I use gesture for getting back on iOS there is problem with scrolling....
Read more >
ScrollView conflicts with NavigationLink swipe-back gesture
Is there anyway to tell ScrollView to ignore the horizontal-ish drag gestures so that NavigationLink can be swiped out properly and smoothly?
Read more >
iOS needs a “back” button or a consistent gesture that just ...
case 1: Close all apps > Open App Store > type “survivor io” in the search and enter > Now try going back...
Read more >
ion-nav | Nav View Component for Ionic Framework Apps
ion-nav is a standalone for loading arbitrary, and pushing new, components on to the stack. Loading Nav view, and pushing others, won't affect...
Read more >
How do I disable Chrome's two-finger back/forward navigation?
System Preferences > Trackpad > More Gestures > Swipe between pages ... It looks like Google Chrome uses Apples default gestures, so by...
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