Opening an alert immediately after an alert closes causes the previous to not dismiss.
The result is, the alerts seem to to Stack.
Prior to 3.5.0 the following was working:
alertOne() {
let alert = this.alertCtrl.create({
title: "Alert One",
subTitle: 'Okay should open the second alert',
buttons: [
{
text: 'Cancel',
role: 'cancel',
handler: data => {
console.log('No clicked');
}
}, {
text: 'Okay',
handler: data => {
this.alertTwo();
}
},
]
});
alert.present();
}
alertTwo() {
let alert = this.alertCtrl.create({
title: "Alert Two",
subTitle: 'Okay should open the third alert',
buttons: [
{
text: 'Cancel',
role: 'cancel',
handler: data => {
console.log('No clicked');
}
}, {
text: 'Okay',
handler: data => {
this.alertThree();
}
},
]
});
alert.present();
}
alertThree() {
let alert = this.alertCtrl.create({
title: "Alert Three",
subTitle: 'Okay should open the first alert',
buttons: [
{
text: 'Cancel',
role: 'cancel',
handler: data => {
console.log('No clicked');
}
}, {
text: 'Okay',
handler: data => {
this.alertOne();//will loop
}
},
]
});
alert.present();
}
A temporary solution is to put a setTimeout on the handler: ( yaya - I know )
setTimeout(() => {
this.alertThree();
}, 100);