Skip to content
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

[RC2] ionViewWillEnter + ionViewWillLeave called in wrong order #9163

Closed
biesbjerg opened this issue Nov 15, 2016 · 1 comment
Closed

[RC2] ionViewWillEnter + ionViewWillLeave called in wrong order #9163

biesbjerg opened this issue Nov 15, 2016 · 1 comment

Comments

@biesbjerg
Copy link

biesbjerg commented Nov 15, 2016

Short description of the problem:

When going via NavController fra PageA to PageB hooks are called in this order:
PageA ionViewWillEnter
PageB ionViewWillEnter
PageA ionViewWillLeave

What behavior are you expecting?

PageA ionViewWillEnter
PageA ionViewWillLeave
PageB ionViewWillEnter

This can be a problem if you are using the hooks to set StatusBar color on ionViewWillEnter and restore to app default on ´ionViewWillLeave`. If the pushed view also sets StatusBar color, it will end up with the restored color from the leaving view.

Hope I'm making any sense :D

Steps to reproduce:

  1. Open plunker (http://plnkr.co/edit/WcrLYlS5PzoUn9lBsX4d?p=preview)
  2. Open console
  3. Click "Go to PageB"

Console now reads:

PageA: ionViewWillEnter
PageB: ionViewWillEnter
PageA: ionViewWillLeave

Plunker that shows an example of your issue

http://plnkr.co/edit/WcrLYlS5PzoUn9lBsX4d?p=preview

@biesbjerg
Copy link
Author

Nice! Thanks a bunch!

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant