I have tabs in my ionic app, when i go to pages and back again to my tabs the tabs-bar will disappear.
Code
tab1
link sample to other pages
<ion-label routerDirection="forward" [routerLink]="['/tabs/', 'groups', group.id]">sample text</ion-label>
And then in my other page i have back button like:
<ion-header>
<ion-toolbar class="header-bg">
<ion-buttons slot="start">
<ion-back-button></ion-back-button> // back to tab1
</ion-buttons>
<ion-title [innerHTML]="messages?.name"></ion-title>
</ion-toolbar>
</ion-header>
But I also have this code in my page component which prevent tabs to be shown in that page.
ngOnInit() {
// hide tab bar in current page
const tabs = document.querySelectorAll('ion-tab-bar');
Object.keys(tabs).map((key) => {
tabs[key].style.display = 'none';
});
}
Note: code above only hides tab bars inside my second page and not tabs page, normally when i back to tabs they should be visible.
PS:I'm not saying that this code cause the issue, I just thought it might be worth to mention that I have such code.
Any idea why my tabs not showing when I back to tabs pages?
nonewhen you don't see them. If so, i'd say a quick fix would be to set it back to something likeblockorflex. Just like you are doing to hide them. - Nicolas