ion-fab in tab bar 'edge' position incorrect REDUX
See original GitHub issueBug Report
This is a repost of https://github.com/ionic-team/ionic/issues/17130 as suggested by @brandyscarney It was closed as dupe of https://github.com/ionic-team/ionic/issues/16780 but is in fact not fixed.
Ionic version: [x] 4.0.2
Current behavior: The fab button sits between the footer and the bottom of the screen
Expected behavior: The fab button should sit between footer and content, like it used to. This used to work with beta13 and earlier.
Steps to reproduce:
Create fresh ionic tabs project $ ionic start myApp tabs
Related code: Add FAB to tabs.page.html as illustrated in doc https://ionicframework.com/docs/api/fab/
<ion-fab vertical="bottom" horizontal="end" edge slot="fixed">
<ion-fab-button>
<ion-icon name="add">
</ion-icon>
</ion-fab-button>
</ion-fab>
Ionic info:
Ionic:
ionic (Ionic CLI) : 4.10.3 (/Users/run-e/.npm-global/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.0.2
@angular-devkit/build-angular : 0.12.4
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.2.4
@ionic/angular-toolkit : 1.4.0
System:
NodeJS : v8.11.2 (/usr/local/bin/node)
npm : 6.7.0
OS : macOS Mojave
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:11 (3 by maintainers)
Top Results From Across the Web
ion-fab in tab bar 'edge' position incorrect REDUX #17696
If we place a fab on top of a tab-bar, how will the user press the tab button? The fab button will be...
Read more >FAB Button over Tabbar - #22 by Vanessa-SC - Ionic Forum
Hi there, I'd like to have a FAB Button overlayed on a buttom tabbar, but can't get it work. As you can see...
Read more >@ionic/angular | Yarn - Package Manager
Ionic is an open source app development toolkit for building modern, fast, top-quality cross-platform native and Progressive Web Apps from a single codebase ......
Read more >ion-tab-button selected
A tab button is a UI component that is placed inside of a tab bar. The tab button can specify ... ion-fab in...
Read more >Source - GitHub
**ios:** The tab bar and toolbar default background colors have been updated to better reflect the latest iOS styles. * **header:** The last...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ahh okay! So the problem with the code you provided is the
fixed
slot only exists on theion-content
element, see the source code here: https://github.com/ionic-team/ionic/blob/master/core/src/components/content/content.tsx#L324Simplified version:
Here is the documentation on the content slots: https://ionicframework.com/docs/api/content#slots
The
slot="fixed"
will have no effect inside of anion-tabs
because it doesn’t contain a slot namedfixed
. Instead, it will go in the default slot for theion-tabs
component, which is inside of the.tabs-inner
div and does not overlay the tab-bar:Tab slots: https://ionicframework.com/docs/api/tabs#slots
You could place the
ion-fab
in thebottom
slot to put it with thetab-bar
, but theedge
property won’t work because it pushes it further down (where it expects a footer to be) which is the opposite of what you want. However, this is something that could be accomplished with a bit of custom CSS:Here’s a Codepen example: https://codepen.io/brandyscarney/pen/qvmvNK?editors=1100
I did like this…
I left an empty tab button to take up space and outside the <ion-tabs> tag inserted my action button.
Result: