ionic-4-components
ionic-4-components copied to clipboard
Image not getting dismissed when using back button on device
Using Ionic 4, tested on Ionic 4.7.4 and 4.6.2. Also is reproducible when using https://fivethree-team.github.io/ionic-4-components/image from a mobile's chrome browser.
Workaround: - Use emitter, didOpen and didClose
<fiv-gallery #fivGallery (didOpen)="onImageOpen()" (didClose)="onImageClose()">
onImageOpen() {
this.backBtnSub = this.platform.backButton.subscribeWithPriority(1, () => {
this.closeImagePopup();
});
}
onImageClose() {
this.backBtnSub.unsubscribe();
}
closeImagePopup() {
this.giveGallery.close();
}