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

Opening Alert from Action sheet doesn't dismiss it

Open Jai-Krish opened this issue 10 years ago • 4 comments

Short description of the problem:

1: Alert doesn't respond while calling it from the Action Sheet. 2: Action sheet doesn't close after opening an Alert from its handle.

What behavior are you expecting?

Action sheet should be dismissed on click.

Steps to reproduce:

  1. Create an Action sheet
  2. Call an Alert from the Action sheet
  3. Close the alert

Other information: The first issue can be handled by using timeout while presenting the Alert view.

Ionic 2.x

Plunker that shows an example of your issue

For Ionic 2 issues - http://plnkr.co/edit/gRMVtVnLNTRNSvKbtUc1?p=preview

Run ionic info from terminal/cmd prompt: (paste output below) Cordova CLI: 6.1.1 Gulp version: CLI version 3.8.11 Gulp local: Local version 3.9.1 Ionic Version: 2.0.0-beta.10 Ionic CLI Version: 2.0.0-beta.21 Ionic App Lib Version: 2.0.0-beta.11 OS: Windows 7 SP1 Node Version: v4.2.4

Jai-Krish avatar Jul 25 '16 07:07 Jai-Krish

Most likely you need to either close the action sheet before opening the alert, or when closing the alert close the action sheet, all these after the transition has finished.

In current alerts the alert returns a promise that resolves when transition is over, i'm almost always forced to attach a .then() function to my alerts that waits for the close transition to finish and only then pops out the navigation with this.nav.pop() or go to a root page as this.nav.setRoot(RootPage).

luchillo17 avatar Jul 28 '16 16:07 luchillo17

Hello @Jai-Krish , thanks for opening an issue with us! I have made a plunker here that shows the correct way to do this. Because all our navigation is async you have to use promises when opening and closing multiple overlay components. Thanks for using Ionic!

jgw96 avatar Jul 28 '16 19:07 jgw96

Damn that's a better explanation, i suck at explaining things, as @jgw96 said if you don't account for the async navigation transitions things break bad.

luchillo17 avatar Jul 28 '16 21:07 luchillo17

Thank you @jgw96 & @Luchillo

Jai-Krish avatar Aug 01 '16 05:08 Jai-Krish