tabsHideOnSubPages doesn't work with popovers

262 views Asked by At

I want to keep the tabs after navigating through the popover. Tabs do not respond to tabsHideOnSubPages:false and are always hidden whenever I navigate using the popover.

To reproduce the issue:

  1. ionic start project testingProject tabs —v2
  2. ionic g page testing

app.module.ts

@NgModule({
  ...
  ,
  imports: [
    IonicModule.forRoot(MyApp, {
      tabsHideOnSubPages: false
    })
  ],
  ...
})

home.html

<ion-header>
  <ion-navbar>
    <button icon-only (click)="presentPopover($event)">
      <ion-icon name="menu"></ion-icon>
    </button>
    <ion-title>Home</ion-title>
  </ion-navbar>
</ion-header>
<ion-content padding>
   ...
</ion-content>

home.ts

export class HomePage {

  constructor(public navCtrl: NavController, private popoverCtrl: PopoverController) {

  }

  presentPopover(event) {
    let popover = this.popoverCtrl.create(HeaderPopover);
    popover.present({
      ev: event
    });
  }
}

header-popover.ts

export class HeaderPopover {
    page: any;
    constructor(public app: App, public viewCtrl: ViewController) {
        this.page = TestingPage;
    }

    closePopover() {
        return this.viewCtrl.dismiss();
    }

    openPage(page) {
        this.closePopover().then(() => {
            this.app.getRootNav().push(page);
        });
    }
}

header-popover.html

<ion-list>
    <button ion-item (click)="openPage(page)">
        <h2>Testing Page</h2>
    </button>
</ion-list>

Ionic info

Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.17
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.47
ios-deploy version: 1.9.0
ios-sim version: 5.0.11
OS: macOS Sierra
Node Version: v6.9.1
Xcode version: Xcode 8.2 Build version 8C38
0

There are 0 answers