RC4 popover.onWillDismiss Not Firing From A Popover Inside Of A Popover
Ionic version: (check one with "x") [ ] 1.x [x] 2.x
I'm submitting a ... (check one with "x") [x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior:
In RC4, when a popover inside of a popover is dismissed, the onWillDismiss callback never fires, OnDidDismiss does fire however.
Expected behavior:
onWillDismiss should fire
Steps to reproduce:
Clone the Ionic2 tutorial and create two popovers. Open one popover from a page and then open the second popover from within the first popover. Add function for onWillDismiss and notice that when the second popover is closed, onWillDismiss never fires but onDidDismiss does.
I've created a dummy project I can share if necessary. I tried the plunker but it appeared to be running rc2.
Related code:
import { Component } from '@angular/core';
import { ViewController, PopoverController } from 'ionic-angular';
import { Pop2 } from './popover2.component';
@Component({
templateUrl: 'popover1.html'
})
export class Pop1 {
constructor(
public viewCtrl: ViewController,
public popoverCtrl: PopoverController
) {
}
openSecondPop(event) {
let popover = this.popoverCtrl.create(Pop2);
popover.onWillDismiss((data) => {
//This never fires!
console.log('on will dismiss data received from second pop: ');
console.log(data);
});
popover.onDidDismiss((data) => {
//This does fire!
console.log('on did dismiss data received from second pop: ');
console.log(data);
});
popover.present({
ev: event
});
}
//Close popover and send option string as a NavParam
close(option: string) {
this.viewCtrl.dismiss({
option: option
});
}
}
Other information:
This has worked since beta 11 I believe and then stopped working with the release of RC4. The first popover does fire onWillDismiss, just not the second popover that is created in the first popover.
Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.17
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.47
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.2.1
Xcode version: Not installed
Just tested this with RC5 and it's still an issue. Reverted back to RC1 and it's working as intended.
Same issue with 2.0 Final. onDidDismiss() somehow works...
Seems to have been fixed somewhere between 3.0.0 and 3.6.0.
I found this behavior on 3.9.2, onDidDismiss() still works.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.