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

v2:bug(modal,alerts) modals and alerts sometimes don't dismiss properly

Open DavidWiesner opened this issue 10 years ago • 5 comments

Short description of the problem:

If I open and dismiss an alert on a page and then open and dismiss a modal I sometimes can't click on any button in <ion-content> on the page any more. I can't figure out exactly when this will happen but under some timing condition this issue occurs.

Sometimes I have to open/dismiss dialog and alert multiple times in sequence until this issue occurs. Sometimes I'm not able to interact with the content of the alert or modal either.

But clicking on a item in the toolbar will still work. But when a click on a toolbar item that will open an alert I can't interact with this alert.

This issue was discovered on an iPhone 6 with iOS 9.3.2. I can't reproduce this issue on two other android devices or on the desktop.

What behavior are you expecting?

A dismissed modal or alert should not blocking clicks on ion-content

Steps to reproduce:

  1. Create a page with a button that open an alert and a button that will open a modal
  2. click one of the button to open the alert
  3. dismiss alert (seems doesn't matter with button click or on backdrop)
  4. open the modal and dismiss them
  5. maybe repeat steps 2-4

Which Ionic Version? 2.0.0-beta.10

Run ionic info from terminal/cmd prompt: (paste output below)

Cordova CLI: 6.2.0 Gulp version: CLI version 3.9.1 Gulp local: Local version 3.9.1 Ionic Framework Version: 2.0.0-beta.10 Ionic CLI Version: 2.0.0-beta.30 Ionic App Lib Version: 2.0.0-beta.16 OS: Distributor ID: Debian Description: Debian GNU/Linux 8.5 (jessie) Node Version: v5.12.0

DavidWiesner avatar Jul 13 '16 08:07 DavidWiesner

Hello, thanks for opening an issue with us! Would you be able to provide a plunker that demonstrates this issue? Thanks for using Ionic!

jgw96 avatar Jul 13 '16 14:07 jgw96

I think there are several issues, but I'm not able to create a plunkr that will reproduce this issue. One part of the issue is maybe the Backdrop because I can't scroll when the issue appears. In backdrop.ts#L45 in ngOnDestroy you preventing the the backdrop count to decrease multiple times with the this.pushed guard. But according to this issue https://github.com/angular/angular/issues/6782 ngOnInit can also be called multiple times.

DavidWiesner avatar Jul 14 '16 06:07 DavidWiesner

Thanks for all the info. I am testing this on all my devices, including an iphone 5 on ios 9.3.2, a Nexus 6 running the latest Android N Beta and a Nexus 7 2013 running Android 6.0.1 (the latest stable Android) and i cant seem to repro this issue. If you could get me a minimal example that i can use to reproduce this issue that would be great! A repo will work if you cannot reproduce it in a plunker.

jgw96 avatar Jul 14 '16 17:07 jgw96

Hello all! As it seems it has been a while since there was any activity on this issue i will be closing it for now. Feel free to comment if you are still running into this issue. Thanks for using Ionic!

jgw96 avatar Jul 19 '16 14:07 jgw96

I'm getting a similar issue, but when I open an alert from a modal.

Specifically, it only happens when I close the alert by clicking outside the alert box. I don't have the error when I dismiss the alert with the ok button.

Doing this creates a similar problem: the user can no longer interact with the ion-content that they see. It's as if the alert isn't being dismissed correctly.

I'm working from a beta 10.5ish so it could be that. I'll see if the issue is still present when I update to beta 11.

haydenJogs92 avatar Aug 05 '16 18:08 haydenJogs92