Ionic Modal opens wrong page after dismiss


#1

When I open a modal with lazy loading pages I have a strange bug.
The Modal is shown normally without problems but when I close the modal the app loads, not the page which created the modal, it loads a completely different page (intro.ts)

I open the modal with this code:

  openRentenInfoPage() {
    this.modalCtrl.create('InfoRentenbescheidPage').present();
  }

I close the modal with this code:

  dismiss() {
    this.viewCtrl.dismiss();
  }

I don’t have this problem on other pages who use a Modal.
This problem is also there when I push the page with the navCtrl…

I created a gif here: https://gifyu.com/images/iOnic3_modal_bug.gif
and a GitHub repo here: https://github.com/MTechDE/ionic-modal-bug
I also created an Issue: https://github.com/driftyco/ionic/issues/11150


#2

Were you ever able to resolve this?


#3

Can you try adding return false after calling your function openRentenInfoPage().

Example: <a href="#" (click)="openRentenInfoPage(); return false;"></a>

I think it will redirect to the link in href if return false is not added. (Reference)