Hi, i want to use navGuard in ion-tab whenever user switch tab. But seem like ionViewCanLeave event was not fired when tab change. It only fire ionViewWillLeave event and i can not find any way to use nav guard in this event.
Personally, I consider nav guards virtually useless and prefer disabling whatever part of the UI would be disallowed by them, such as buttons and menu items. So if a particular tab is off-limits for whatever reason, I would disable that tab. If you’re in a situation where the user isn’t supposed to go anywhere until something happens, then I think you should consider using a modal for that. That’s what they’re for.
Thanks for your reply. You are right in some cases. But in my case, it is similar with filling up form in a tab. If user leave the tab without save data, they will lost that data. So i think navGuard in this case is necessary.