Ionic-framework: bug: no back button when push page from popover (beta11)

Created on 11 Aug 2016  路  4Comments  路  Source: ionic-team/ionic-framework

Short description of the problem:

When using NavController from a popover.dismiss to push a page, the page is shown without a back button on navbar.
When it is pushed without dismiss, it works ok.
Hardware back button works as expected.

What behavior are you expecting?

To see a back button on navbar

Steps to reproduce:

  1. ionic serve on https://github.com/hagai26/ionic-conference-app
  2. go to About Page using the side menu
  3. click popover -> push signup page no dismiss (there is back button)
  4. click popover -> push signup page (no back button - BUG)
  // bug
  pushSignupPage() {
    this.viewCtrl.dismiss().then(() => {
      this.navCtrl.push(SignupPage);
    });
  }
  // no bug
  pushSignupPageNoDismiss() {
    this.navCtrl.push(SignupPage);
  }

Which Ionic Version?
Your system information:

Cordova CLI: 6.3.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.11
Ionic CLI Version: 2.0.0-beta.36
Ionic App Lib Version: 2.0.0-beta.19
ios-deploy version: 1.8.6
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v6.3.1
Xcode version: Xcode 7.3.1 Build version 7D1014

reply

Most helpful comment

Hello! Thanks for opening an issue with us! Im pretty sure that the issue here is that your are calling push() from the popovers navController (because all overlay components now have their own nav in beta.11) instead of the "main" navController. Would you mind trying this?

 import { App } from 'ionic-angular';

constuctor(public app: App) {};

pushSignupPage() {
    this.viewCtrl.dismiss().then(() => {
      this.app.getRootNav().push(SignupPage);
    });
  }

Thanks for using Ionic!

All 4 comments

Hello! Thanks for opening an issue with us! Im pretty sure that the issue here is that your are calling push() from the popovers navController (because all overlay components now have their own nav in beta.11) instead of the "main" navController. Would you mind trying this?

 import { App } from 'ionic-angular';

constuctor(public app: App) {};

pushSignupPage() {
    this.viewCtrl.dismiss().then(() => {
      this.app.getRootNav().push(SignupPage);
    });
  }

Thanks for using Ionic!

Great, I didn't notice that.
It works great! 10x

This work great with ionic back button
but how to join it with device Back Button

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. 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.

Was this page helpful?
0 / 5 - 0 ratings