Hello,
I’m migrating an App from Ionic 2 (rc5) to ionic 3.
On one of the pages, I have an alert (prompt) that is triggered by clicking an actionSheet item
presentActionSheet() {
let actionSheet = this.actionSheetCtrl.create({
title: 'Edit',
buttons: [
{
text: 'Rename',
handler: () => {
this.showRename();
}
}
]
});
actionSheet.present();
}
showRename() {
let prompt = this.alertCtrl.create({
title: 'Rename',
message: "Enter a name",
inputs: [
{
name: 'Name',
placeholder: ''
},
],
buttons: [
{
text: 'Cancel',
handler: data => {
console.log('Cancel clicked');
}
},
{
text: 'Save',
handler: data => {
console.log('Saved clicked');
}
}
]
});
prompt.present();
}
The problem is that none of the button is working: the console.log are there when I click but the alert simply doesn’t close.
If I put the showRename() function in the constructor to show the alert directly when the page load or on a button click for example, the behavior is correct (button clicked = closing the alert).
This was working fine with the previous version of Ionic I used, it’s the last and only problem I encountered while migrating (for the moment ^^).
Does someone have an idea of why it happens ?
global packages:
@ionic/cli-utils : 1.4.0
Ionic CLI : 3.4.0
local packages:
@ionic/app-scripts : 1.3.12
@ionic/cli-plugin-ionic-angular : 1.3.1
Ionic Framework : ionic-angular 3.5.0
System:
Node : v6.9.4
OS : Windows 10
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed
npm : 3.10.10
Thanks,