Hi,
I have a TabsPage
with 4 individual tab pages inside.
In “Feedback” tab page, I want to jump to “Home” tab page when a submit
(send!) button is clicked.
This is the feedback page content
After clicking “Send!” (submit) button, the screen displays homepage content while tab highlight is wrong in “Feedback” - screenshot below
Only by clicking twice the “Feedback” tab on the bottom, the screen will display content correctly.
Did I make anything wrong in the code?
TabsPage html file
<ion-tabs [selectedIndex]="tabIndex">
<ion-tab [root]="tab1Root" tabTitle="Home" tabIcon="home"></ion-tab>
<ion-tab [root]="tab2Root" tabTitle="Timeline" tabIcon="information-circle"></ion-tab>
<ion-tab [root]="tab3Root" tabTitle="Feedback" tabIcon="contacts"></ion-tab>
<ion-tab [root]="tab4Root" tabTitle="My" tabIcon="settings"></ion-tab>
</ion-tabs>
TabsPage ts file
tabIndex: number = 0;
constructor(public navParams: NavParams, public utilProvider: UtilProvider) {
this.tabIndex = navParams.get("openTab") || 0;
}
Feedback page ts file
submit() {
this.navCtrl.setRoot("TabsPage", {
openTab: 0
});
}