Dismiss modal on tab click

I have 4 tabs in an app.In the second tab i have a modal when we click some button and from that modal we will navigate to second modal in the same tab.But,when we press the other tabs the modal should hide either if it is a first modal or second modal.

I have same issue. Can anyone solve this issue!!

Same problem here :-/

I think the ion-backdrop that gets put behind the modals are the cause of the problem.

upon opening a 2nd modal, without dismissing the original, there are now 2 ion-backdrops between your modal and the root/tabs.

have you tried clicking the outside the modal twice to see if they both dismiss?

in the modal.ts component, before calling the ‘create’ method for the second modal, I added

this.modalCtrl.dismiss(); //v4
this.viewCtrl.dismiss(); // v3 <-- its been a while but I am pretty sure

and this hides the first one and then shows the second 1
Hope this helps!!