Skip to content

Ion-fab show behind the toolbar #16780

Closed
Closed

Description

@joel-daros

Bug Report

[x] 4.0 BETA 19

Current behavior:
Afer Beta 18 the ion-fab is showed behind the toolbar.

image

Expected behavior:
The fab button should appear above the toolbar like previous versions.

Related code:

<ion-header no-border>
  <ion-toolbar color="primary">
    <ion-title> <img src="assets/imgs/dark.svg" height="46" /> </ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>
   <ion-fab vertical="top" horizontal="end" edge slot="fixed">
    <ion-fab-button color="tertiary" (click)="navigateToEditProfile(profileId)">
      <ion-icon name="create"></ion-icon>
    </ion-fab-button>
  </ion-fab>

  <ion-list-header color="secondary" no-margin>
    <ion-label>
      <h1 text-uppercase>PERFIL</h1>
    </ion-label>
  </ion-list-header>

  <div>....</div>

</ion-content>

Ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.5.0 (/Users/xxx/.nvm/versions/node/v10.14.1/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.0-beta.19
   @angular-devkit/build-angular : 0.11.3
   @angular-devkit/schematics    : 7.1.3
   @angular/cli                  : 7.1.3
   @ionic/angular-toolkit        : 1.2.0

Cordova:

   cordova (Cordova CLI) : 8.1.2 ([email protected])
   Cordova Platforms     : none
   Cordova Plugins       : no whitelisted plugins (0 plugins total)

System:

   NodeJS : v10.14.1 (/Users/xxx/.nvm/versions/node/v10.14.1/bin/node)
   npm    : 6.5.0
   OS     : macOS Mojave
   Xcode  : Xcode 9.4 Build version 9F1027a

Activity

  1. brandyscarney commented on Dec 17, 2018

    @brandyscarney
    Member

    You need to have slot="fixed" on the ion-fab if you'd like it to position it over the content & toolbar. Please see the usage here: https://beta.ionicframework.com/docs/api/fab. Thanks!

  2. joel-daros commented on Dec 17, 2018

    @joel-daros
    Author

    @brandyscarney, please reopen:

    I'm tried adding slot="fixed" but the problem keeps:
    <ion-fab vertical="top" horizontal="end" slot="fixed" edge>

    I notice the problem occurs when I use edge directive to make the button overlapping the head.

    I also update the example provided in the first post.

  3. paulstelzer commented on Dec 17, 2018

    @paulstelzer
    Contributor

    @brandyscarney @MrSparklle is right. In the current state it's not working.

    It's not header only, footer, too

    beta.17 (ionic docs):
    firefox_2018-12-17_18-16-03

    current master (http://localhost:3333/src/components/fab/test/preview):
    chrome_2018-12-17_18-20-06

  4. added
    package: core
    type: bug
    and removed on Dec 17, 2018
  5. brandyscarney commented on Dec 17, 2018

    @brandyscarney
    Member

    I'm not sure what's going on here. I am not seeing the same thing on the preview test (on master after running a fresh npm i):

    I also can't reproduce it in a codepen using 4.0.0-beta.19: https://codepen.io/brandyscarney/pen/KbgKNw
    I was only able to reproduce the problem when slot="fixed" was missing, but adding it fixed it.

    Is there a specific browser this is happening on or is it on several?

  6. paulstelzer commented on Dec 17, 2018

    @paulstelzer
    Contributor

    @brandyscarney I tested your codepen. It has the same behaviour. It's behind the toolbar (using Chrome 71)

    chrome_2018-12-17_20-20-28

    I downgraded to beta.17 / beta,16, but there it's still behind the toolbar. Maybe Chromium has a change?

  7. brandyscarney commented on Dec 17, 2018

    @brandyscarney
    Member

    @paulstelzer Thanks! Apparently I needed to relaunch Chrome to update it, so I can now reproduce it in latest Chrome. This helps narrow the problem down!

  8. brassier commented on Dec 18, 2018

    @brassier

    For more info, this is also appearing in Ionic 3.9.2. It is also seen in the Ionic Docs.

  9. brassier commented on Dec 18, 2018

    @brassier

    Also note that this works fine in FireFox. Only seems to be a problem with Chrome 71.

    I stink at CSS, but I attempted to break this down into a simpler example that shows something working in FireFox and not in Chrome, based on hunting and pecking the tons of styles going on in the Ionic app I have. A (semi-embarrassing) example is below. Again, this shows a fake FAB that appears normal in FireFox, which appears under a fake header in Chrome. It really seems like z-index is handled differently since the 999 z-index raises the FAB to the top in FF but not in Chrome.
    https://js-bjvaxt.stackblitz.io/

    Of course there are hacks we could do to make this work again. I'm just not convinced I have a "proper" fix in mind.

  10. brassier commented on Dec 18, 2018

    @brassier

    A bit more info. In my testing it looks like the following style on ion-content may be the key trigger point that Chrome and FF are treating differently:

    contain: layout size style;
    

    Disabling that style on Chrome 71 makes the FAB on top again.

  11. 12 remaining items

  12. brandyscarney commented on Jan 9, 2019

    @brandyscarney
    Member

    Chrome added it in 52, so while it may have not been working the same from a UI perspective it was still doing something. 🙂We will check it against all of our tests though.

    https://developers.google.com/web/updates/2016/06/css-containment
    https://www.chromestatus.com/features/6522186978295808

  13. added a commit that references this issue on Jan 10, 2019
    c343a88
  14. DarkAnivia commented on Jan 11, 2019

    @DarkAnivia

    Thank you, we will try aswell

  15. added 2 commits that reference this issue on Jan 17, 2019
    0cf1894
    f8e3cff
  16. redwolf2 commented on Feb 12, 2019

    @redwolf2

    It's fixed for Ionic 4, but Ionic 3 still has this problem.

  17. brandyscarney commented on Feb 12, 2019

    @brandyscarney
    Member
  18. redwolf2 commented on Feb 12, 2019

    @redwolf2

    @brandyscarney Thx, I will check that out.

  19. Frotty commented on Mar 1, 2019

    @Frotty

    Hi, my issue #17130 has been locked.
    I still have this exact problem, nothing has been fixed.

  20. brandyscarney commented on Mar 1, 2019

    @brandyscarney
    Member

    @Frotty Could you please open a new issue with your current Ionic version and steps to reproduce please? Thank you!

  21. ionitron-bot commented on Mar 31, 2019

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  22. locked and limited conversation to collaborators on Mar 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

package: coretype: bug

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions