Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Alert control is not dismissing after opening from the action sheet button event in Ionic3.5 #31

Open
ionitron-bot bot opened this issue Nov 1, 2018 · 0 comments · May be fixed by Jankyboy/ionic-v3#7, Jankyboy/ionic-v3#9 or Jankyboy/ionic-v3#19
Labels

Comments

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 1, 2018

Ionic version: (check one with "x")
[ ] 1.x (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[ x] 3.x

I'm submitting a ... (check one with "x")
[x ] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:
I have an action sheet into my project and opening an alert control by selecting the action sheet button. the alert box open but while clicking the alert button then alert control is not dismissing/closing itself. it always stays on the page.

Expected behavior:
The alert control should be dismissed/close after pressing the Agree/Disagree button.

Steps to reproduce:

  1. add an action sheet into one of ionic page
  2. add the alert control into that page.
  3. open an alert control using action sheet button.
  4. try to close the alert control using one of agree disagree button

Related code:

presentActionSheet() {
     let self = this;
    let actionSheet = this.actionSheetCtrl.create({
      title: 'Modify your album',
      buttons: [
        {
          text: 'Destructive',
          role: 'destructive',
          handler: () => {
            console.log('Destructive clicked');
            self.showConfirm();
          }
        },{
          text: 'Archive',
          handler: () => {
            console.log('Archive clicked');
            self.showConfirm();
          }
        },{
          text: 'Cancel',
          role: 'cancel',
          handler: () => {
            console.log('Cancel clicked');
          }
        }
      ]
    });
    actionSheet.present();
  }
showConfirm() {
  
    let confirm = this.alertCtrl.create({
      title: 'Use this lightsaber?',
      message: 'Do you agree to use this lightsaber to do good across the intergalactic galaxy?',
      buttons: [
        {
          text: 'Disagree',
          handler: () => {
            console.log('Disagree clicked');
            confirm.dismiss();
          }
        },
        {
          text: 'Agree',
          handler: () => {
            console.log('Agree clicked');
             confirm.dismiss();
          }
        }
      ]
    });
    confirm.present();
  }

https://drive.google.com/open?id=0B6aMbU1-vMowSVRvU0JQdk1SZ0U
https://drive.google.com/open?id=0B6aMbU1-vMowRjJQQ0M0R0JtUEU

Other information:

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

global packages:

@ionic/cli-utils : 1.4.0
Cordova CLI      : 6.5.0 
Ionic CLI        : 3.4.0

local packages:

@ionic/app-scripts              : 1.3.12
@ionic/cli-plugin-cordova       : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms               : android 6.1.2 browser 4.1.0 ios 4.1.1
Ionic Framework                 : ionic-angular 3.5.0

System:

Node       : v7.0.0
OS         : macOS Sierra
Xcode      : Xcode 8.3.1 Build version 8E1000a 
ios-deploy : 1.9.1 
ios-sim    : 5.0.10 
npm        : 4.6.1 
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
0 participants