Open ebhsgit opened 4 years ago
The class name show
is not being applied to the element, because the FabList component handles the classes and does not listen for changes. They also don't mention that you could show / hide them in the documentation. So this is a feature request, rather than a bug report.
Here are two possibilities:
<button ion-fab mini *ngIf="someCondition" [class.show]="someCondition">
<ion-icon name="create"></ion-icon>
<ion-label>Button 2</ion-label>
</button>
Or better:
<button ion-fab mini [hidden]="!someCondition">
<ion-icon name="create"></ion-icon>
<ion-label>Button 2</ion-label>
</button>
If you like, you can implement the feature and create a pull request.
You could extend the FabList in a way, that you listen for changes of the ContentChildren and apply then the styles, when something changed.
https://github.com/ionic-team/ionic-v3/blob/master/src/components/fab/fab-list.ts
Thanks @StefanRein,
[class.show] is the work-around I have implemented in my code at the moment.
I'm submitting a ... (check one with "x") [x] bug report [ ] feature request
Current behavior: In a ion-fab list with the following setup. If the list is already "open" when the condition change to true, the conditional ion-fab button is added but it is not visible. Closing and re-opening the list will make the button visible.
Expected behavior: The button should be visible if the condition is true
Steps to reproduce:
Notice the empty, space is created for Button 2.
Related code:
http://plnkr.co/edit/vsT0ulutHJAjyFRCRIaG?p=preview
Other information: The issue seems to be the ion-fab button does not have the "show" css class.
Ionic info: (run
ionic info
from a terminal/cmd prompt and paste output below):