Skip to content

bug(tab): show not being adhered to #6412

Closed
@dylanvdmerwe

Description

@dylanvdmerwe

Short description of the problem:

I need to hide or display a tab depending on the state of the application. It seems on iOS I cannot get the tab to hide once it has been displayed.

What behavior are you expecting?

The tab should hide/display based on the value of the [show] property as per the documentation.

HTML

<ion-tabs>
    <ion-tab [root]="tab2Root" tabTitle="Info" tabIcon="information-circle"></ion-tab>
    <ion-tab [root]="tab1Root" tabTitle="Prizes" tabIcon="trophy" [show]="competitionRunning"></ion-tab>
    <ion-tab [root]="tab3Root" tabTitle="Gallery" tabIcon="images"></ion-tab>
    <ion-tab [root]="tab4Root" tabTitle="Inbox " tabIcon="chatbubbles"  [tabBadge]="userState.unreadMessageCount" tabBadgeStyle="danger" ></ion-tab>
</ion-tabs>

TS

export class TabsPage {
  tab1Root: any = InvitePage;
  tab2Root: any = InfoPage;
  tab3Root: any = GalleryPage;
  tab4Root: any = InboxPage;

  competitionRunning: boolean = true;

  constructor(private userState : SystemUserState, private appState : ApplicationInfoState){

  } 

  onPageLoaded(){
      var university = this.appState.findUniversity(this.userState.universityId);
      this.competitionRunning = university.Competition.IsRunning;
  }
}

When competitionRunning is set to false or true in onPageLoaded on iOS, the tab will still be shown regardless. Tested on an actual device.

Which Ionic Version? 2.x

Cordova CLI: 6.1.1
Ionic Framework Version: 2.0.0-beta.6
Ionic CLI Version: 2.0.0-beta.24
Ionic App Lib Version: 2.0.0-beta.14
OS:
Node Version: v5.10.1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions