Skip to content

bug: removed toolbar bottom padding if tab-bar[style="display: none"] #25791

Description

@rdlabo

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

#25746 is removed toolbar bottom padding if tab-bar[style="display: none"].

The solution of not displaying the tab-bar on the page after the push transition is often used.

<ion-tabs>
  <ion-tab-bar slot="bottom" style="display: none">
    <ion-tab-button tab="tab1">
      <ion-icon name="triangle"></ion-icon>
      <ion-label>Tab 1</ion-label>
    </ion-tab-button>
</ion-tabs>

This is reproduced in v6.2.3.

Expected Behavior

if tab-bar[style="display: none"], toolbar has bottom padding.

Steps to Reproduce

Add code to tabs.page.ts to control the display of the tab bar.

import { Component } from '@angular/core';

@Component({
  selector: 'app-tabs',
  templateUrl: 'tabs.page.html',
  styleUrls: ['tabs.page.scss']
})
export class TabsPage {

  constructor(private router: Router) {}

  public async ngOnInit() {
    this.router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe((params: NavigationEnd) => {
      const tabBar = document.querySelector('ion-tab-bar') as HTMLElement;
      if (tabBar) {
        tabBar.style.display = ['/tab1', '/tab2', '/tab3'].indexOf(params.urlAfterRedirects) >= 0 ? 'flex' : 'none';
      }
    });
  }
}

Then add a child page with a push transition and add ion-footer to reproduce.

Code Reproduction URL

No response

Ionic Info

Ionic:

   Ionic CLI                     : 6.19.0 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 6.2.3
   @angular-devkit/build-angular : 14.1.2
   @angular-devkit/schematics    : 14.1.2
   @angular/cli                  : 14.1.2
   @ionic/angular-toolkit        : 5.0.3

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions