Should I post this as an issue as there seems to be no fix


#1

Hi all,

I’ve made several post about this issue before and googled the hell out of it but cannot find an answer. Believe it could be a bug.

Issue (EDITED): I’m pushing a page onto the nav stack and the auto generated back button in the navbar does not work on android.

Or to put it another way, when I’m using the app - I’m on the home page, hit the side menu button and select a link on the side menu to go to another page. Here the page opens but the back button (on android) will not go back to the home page.

In my example it start from the sidemenu --v2 starter template.

app.component.ts

import { Component, ViewChild, } from '@angular/core';
import { Nav, Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';

import { HomePage } from '../pages/home/home';
import { ListPage } from '../pages/list/list';

@Component({
  templateUrl: 'app.html',
})
export class MyApp {
  @ViewChild(Nav) nav: Nav;

  rootPage: any = HomePage;
  listPage = ListPage;

  constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen) {
    this.initializeApp();
  }

  initializeApp() {
    this.platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      this.statusBar.styleDefault();
      this.splashScreen.hide();
    });
  }

  openPage(page) {
    this.nav.push(page).catch(() => {
      console.log("Unable to load page");
    })

  }
}

app.html

<ion-menu type="overlay" [content]="content">

  <ion-content>
    <ion-list>

      <button menuClose ion-item detail-none (click)="openPage(listPage)">
        My Trips
      </button>

    </ion-list>
  </ion-content>

</ion-menu>

<!-- Disable swipe-to-go-back because it's poor UX to combine STGB with side menus -->
<ion-nav [root]="rootPage" #content swipeBackEnabled="true"></ion-nav>

End up with a back button on the opened page that does nothing, but as said works on ios.
Thanks


#2

Sorry, I don’t understand your description of the problem. Could you try again?

Also post your ionic info output please.


#3

Hi,

Yep - I’m pushing a page onto the nav stack and the auto generated back button in the navbar does not work on android.

Or another way, when I’m using the app - I’m on the home page, hit the side menu button and select a link on the side menu to go to another page. Here the page opens but the back button (on android) will not go back to the home page.

That make sense?

Will post ionic info shortly.

Thanks


#4

Cordova CLI: 7.0.1
Ionic Framework Version: 3.3.0
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.7
ios-deploy version: 1.9.1
ios-sim version: 6.0.0
Node Version: v6.9.1
Xcode version: Xcode 8.3.3 Build version 8E3004b


#5

May have isolated the issue. Using chrome inspector I can inspect the auto generated back button and see it has a bunch of classes,

<button> back-button, disable-hover, bar-button-md, back-button-md . . .

The interesting thing is, when I change all the items that contain ‘md’ to ‘ios’ for example,
from bar-button-md to bar-button-ios the back button works okay.

Anyone know why this might be?

Thanks