Skip to content

[feat] Allow for customizing the alert's dismissal #6855

@iignatov

Description

@iignatov

Short description of the problem:

Currently it's not possible to configure Alert's dismissal although it's supported by the ViewController.

What behavior are you expecting?

To be able to pass NavOptions to Alert.dimiss() in order to configure how an alert is dismissed.

// https://github.com/driftyco/ionic/blob/2.0/src/components/alert/alert.ts
class AlertCmp {
  // ...
  dismiss(role: any): Promise<any> {
    return this._viewCtrl.dismiss(this.getValues(), role);
  }
  // ...
}

// https://github.com/driftyco/ionic/blob/2.0/src/components/nav/view-controller.ts
export class ViewController {
  //...
  dismiss(data?: any, role?: any, navOptions: NavOptions = {}) {
    let options = merge({}, this._leavingOpts, navOptions);
    return this._nav.remove(this._nav.indexOf(this), 1, options).then(() => {
      this._onDismiss && this._onDismiss(data, role);
      return data;
    });
  }
  // ...
}

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

https://forum.ionicframework.com/t/2-0-0-beta8-modal-animation-issue/54332

Which Ionic Version? 2.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions