Issue
I’m using Ionic 4 with Angular 8 I want to “Disable” modal dismiss when i press android hardware “back” button.
this.platform.backButton.subscribe(() => {
console.log("Button Pressed");
});
I can trace the event but i can’t prevent ionic to dismiss modal.
Solution
this.platform.backButton.subscribe(async () => {
console.log("Button Pressed");
if (this.modalCtrl.getTop()) {
const modal = await this.modalCtrl.getTop();
if (modal) {
console.log('ModalCtrl Top');
return;
}
}
});
Answered By - Manish
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.