presenting ActionSheet when a toast is displayed crash the app
Short description of the problem:
Presenting ActionSheet when a toast is displayed crash the app
What behavior are you expecting?
The ActionSheet should not be crashed, and the toast should be automatically closed
Steps to reproduce: use this code :
import { ActionSheetController , NavController, ToastController} from 'ionic-angular';
import {Component} from '@angular/core';
@Component({
template: `
<ion-header>
<ion-navbar hideBackButton>
<ion-title>Credits</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding class="has-header components-demo cards-bg social-cards">
<button block (click)="openMenu()">
Action sheet
</button>
<button block (click)="showToast('bottom')">Toast Bottom</button>
</ion-content>`,
})
export class CreditsMain {
constructor(public nav: NavController, private toastController : ToastController, private actionSheetController : ActionSheetController) { }
showToast(position: string) {
let toast = this.toastController.create({
message: 'Mmmm, buttered toast',
duration: 2000,
position: position
});
toast.present();
}
openMenu() {
let actionSheet = this.actionSheetController.create({
title: 'Albums',
buttons: [
{
text: 'Delete',
role: 'destructive',
icon: 'trash',
handler: () => {}
},
{
text: 'Cancel',
role: 'cancel', // will always sort to be on the bottom
icon: 'close',
handler: () => {}
}
]
});
actionSheet.present();
}
}
- open the toast, and then the ActionSheet
- the app is crashed :
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
browser_adapter.js:84 EXCEPTION: Error in ./AppRoot class AppRoot_Host - inline template:0:0
browser_adapter.js:84 ORIGINAL EXCEPTION: Expression has changed after it was checked. Previous value: 'false'. Current value: 'true'
Which Ionic Version? 1.x or 2.x ionic 2 beta 11
Run ionic info from terminal/cmd prompt: (paste output below)
Cordova CLI: 6.3.0 Ionic Framework Version: 2.0.0-beta.11 Ionic CLI Version: 2.0.0-beta.37 Ionic App Lib Version: 2.0.0-beta.20 OS: Node Version: v4.4.6
NB : probably related to https://github.com/driftyco/ionic/issues/7449, but we should be able to present a toast and let the ability to the user to continue using the app (that can have 'permanent' popover/modal/actionsheet buttons)..
Hello! Thanks for opening an issue with us! This has actually already been fixed on another branch and will be in the beta.12 release. Thanks for using Ionic!