Lifecycle event for losing visiblity of page



Is there any lifecycle event if active page loses visibility but it was not left e.g. modal has been presented and covered the page. I tried ionViewWillLeave but it will only fire if page was left. If there is no lifecycle event, how can I solve it please ?

I’d appreciate any help
Best Regards


What is it that you want to do? If you present a modal from a page, the page is always ‘left’.i.e the modal stacks above the calling page.


I just wanna call some function if page will leave. Why does ionViewWillLeave event not work ? I don’t get it


can you post your code? what’s your ionic version?