Skip to content

bug: .fab-horizontal-center class is not responsive #22564

Description

@1x2x3x4x

Bug Report

Ionic version:

[ ] 4.x
[x] 5.x

Current behavior:

If you change the size of ion-fab-button as suggested here by @brandyscarney the ion-fab-button that are centered will not be centered anymore, they'll be shifted to the right a few pixels, enough to notice specially on phones.

Expected behavior:

If you change the height/width it should keep centering properly.

Steps to reproduce:

Just create ion-fab-button centered and change the sizes.

Related code:

Stackblitz
Go to tab 1 and you'll see the bottom, centered fab shifted.

<ion-app>
  <ion-fab vertical="bottom" horizontal="center" slot="fixed">
    <ion-fab-button>
      <ion-icon name="add"></ion-icon>
    </ion-fab-button>
  </ion-fab>
  <ion-content class="ion-padding">
    <ion-fab-button mode="ios">
      <ion-icon name="heart"></ion-icon>
    </ion-fab-button>
  </ion-content>
</ion-app> 

ion-fab-button {
  width: 100px;
  height: 100px;
} 

Other information:

Ionic info:

Ionic CLI                     : 6.11.10
   Ionic Framework               : @ionic/angular 5.3.2
   @angular-devkit/build-angular : 0.803.27
   @angular-devkit/schematics    : 10.1.3
   @angular/cli                  : 8.3.27
   @ionic/angular-toolkit        : 2.3.3

System:
   Android SDK Tools : 26.1.1 
   NodeJS            : v14.15.1 
   npm               : 6.14.8
   OS                : Windows 10

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