-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ionic2 RC.0 - Tab page leave lifecycle events do not fire #8547
Comments
I just tested this and Can you share some code? Or, try master as I just pushed a fix that maybe is related (tested w and w/o the fix though) |
hm yeah ill try that out with master and see it works. Could you direct me to the commit that may have fixed it? Is there a plunker template anywhere for rc.0? |
@mlynch In what way are you popping from the tabs page. Is it like what I did? |
After a bit more testing, I have found the following behavior in the rc.0 code.
|
Same here, I was excepting that ionViewWillLeave or ionViewDidLeave would have been triggered on the main TabsPage when another pages would have been set as new root, but it isn't the case. Or maybe it's just a misunderstanding of my side of the lifecycle events. In such case, is there any documentation about the lifecycle events, specially when using tabs and what happens (aka what is triggered) when something is pushed or set as new root? |
NOTE TO MYSELF: should be resent the lifecycle events to the active tab when we are leaving the all the tabs (setRoot)? |
Just found this today with the final. Using setRoot from within a tab does not trigger the WillLeave,Leave and Unload events for the tab. However ngOnDestroy() for the tab is being called. |
Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. Thank you for using Ionic! |
Short description of the problem:
I already know this will probably get dismissed, just like #8233, #5351, and so on. But I'm pretty sure this problem arises from having a Tabs page at a place other than the root of the application.
These lifecycle events such
ionViewWillLeave
only fire when clicking on another tab. But if navigating away with a Menu or a Custom Back Button (with this.nav.parent.parent.pop()), the events do not fire. I mean, the fact that I even have a custom back button is solely because Tabs is only allowed at the root. So I am once again requesting that Tabs be allowed to exist anywhere on the stack...But at the very least I'm hoping this issue will be fixed.Let me know if you want a plunker.
What behavior are you expecting?
I expect all lifecycle events to fire properly no matter where I am in the stack.
The text was updated successfully, but these errors were encountered: