ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

ionic2 FAB button <ion-fab-list> should be hide when click

Open Tusharbalar opened this issue 9 years ago • 6 comments

Ionic Info: Cordova CLI: 6.4.0 Ionic Framework Version: 2.0.0-rc.3 Ionic CLI Version: 2.1.8 Ionic App Lib Version: 2.1.4 Ionic App Scripts Version: 0.0.45 ios-deploy version: Not installed ios-sim version: Not installed OS: Linux 4.6 Node Version: v4.6.0

I am working with <ion-fab></ion-fab> button. I am not able to close <ion-fab-list> when I click on someone. It should be hidden (minimized) when a user clicks on any button.

imageedit_5_4414585966

  1. When I click on edit button it should be the close <ion-fab-list> list of the button.

  2. When I click on anywhere on screen it should be closed <ion-fab-list>.

Tusharbalar avatar Dec 20 '16 09:12 Tusharbalar

You could try this in the meantime:

.html

<ion-fab top right #fab>
  <ion-fab-list side="bottom">
    <button ion-fab (click)="gotoTrash($event, fab)">
        <ion-icon  name="trash"></ion-icon> 
      </button>
  </ion-fab-list>
</ion-fab>

.ts

import {  FabContainer } from 'ionic-angular';
.
.
.
gotoTrash(event, fab: FabContainer) {
    fab.close();
    this.navCtrl.push(TrashPage);
  }

wrosb avatar Dec 20 '16 16:12 wrosb

Hey @Tusharbalar ! Thanks for posting an issue with us. The above code is actually the correct way to implement this behavior. You can read more about this in our docs here.

jgw96 avatar Dec 21 '16 19:12 jgw96

Is it possible to know when the fab-list is closed ???

jorgemejia avatar Jul 13 '17 21:07 jorgemejia

how can the ion-fab-list be extended/presented on defauld?

gischy avatar Feb 04 '18 03:02 gischy

Actually, you dont need to handle this on the ts file. You can simply add it to the click event:

<button ion-fab (click)="fab.close();gotoTrash($event)">

jhonatasblue avatar Feb 23 '18 22:02 jhonatasblue

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.

ionitron-bot[bot] avatar Sep 01 '18 08:09 ionitron-bot[bot]