-
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
bug: Closing select dialog triggers onPageWillEnter #5516
Comments
On a similar point, I have onPageWillEnter firing after closing an alert. Not sure if that is as designed, caught me out for a while |
Ok, I think I see the problem, where when a modal/alert/actionsheet is technically another page that loaded in the nav stack, and when it's removed then the page before it "entered" again. For sure the ion-select probably shouldn't do this, since conceptually it's apart of the page. That's also debatable for alert and actionsheet. However, for modal the previous page should onPageWillEnter. I'll add it to beta2 and take a look, thanks. |
From my perspective, an Alert is just an alert, not a page. I guess I view the new alert as a replacement for Window.alert to make it look pretty. I guess I view it as fundamentally different than a Modal, where my Modal does take a Page component as a parameter and display that. When I close a Modal, I would expect the underlying page's onPageWillEnter to be called. It's interesting though - I am not so sure I would feel that way in a master/detail view, so iPad or decent sized browser. It may be worth looking at what Cocoa Touch does and when it calls viewWillAppear. |
If not too onerous, that leads to a thought - perhaps have onViewWillEnter for a view entry event (including after closing alerts, actionsheets, selects), and onPageWillEnter for where its a page, with a page constructor (i.e. excluding alerts, actionsheets, selects) That way, we can use the one we want, depending upon circumstances |
For Alert and ActionSheet, the currently active page’s leaving lifecycle event should not fire. However, for Modal, the currently active page’s leaving lifecycle should fire. Closes #5516
Awesome thanks for the issue, I think this is a good update. So now alerts, actionsheets and ion-selects, won't fire the active page's lifecycle events. Thanks! |
Type: bug
Ionic Version: 2.x
Platform: all
I have an @page component with a form. I am using the ion-select component. After I make my selection and close the dialogue, it calls onPageWillEnter again. This seems like a bug to me.
It is very easy to reproduce. If you need code I can give you code. This is with beta1 npm module.
The text was updated successfully, but these errors were encountered: