-
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
[v4.0.0-beta.12] ionViewDidEnter not triggered in modals #15806
Comments
All of them is not valid in Ionic 4 as far as I know. You have to use the Angular lifecycle
|
@paulstelzer only In case of the modal, see lifecycle map https://github.com/ionic-team/ionic/blob/c49d896e085278a4ece521a22d983a4fa745adc2/core/src/components/modal/modal.tsx furthermore, I checked |
I am shocked :D I do not understand why they left the lifecycles in it - ngOnInit etc are already included in Angular, so no need to leave it in |
@paulstelzer I'm really happy they did, easier to migrate and also I think anyhow, maybe I'm totally wrong you know ;) let's see what they say P.S.: In any case for me no rush anymore, I've already modified my upcoming app in order to not use anymore |
Just use ngOnInit instead of ionViewDidEnter at modals, it's working ;) Upgraded my modals this way, too and componentProps also working in this lifecycle And yeah, waiting for an answer why they left the lifecycles in it - for me it makes no sense (already hated them in Ionic 3 because it breaks with Angular) |
I don't think ngOnInit() takes account of the animation of the modal. I've been trying to hook onto an event that's fired once the modal is presented (ionModalDidPresent), in order to measure some of the elements inside and do a bit of re-sizing - I always get 0 size back when doing this in ngOnInit(). For the time being, I have had to add a setTimeout of 0.5s from ngOnInit() being fired until I do the measuring to allow for the animation delay. |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. 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. |
Bug Report
Ionic Info
Ionic Angular v4-beta.12
Describe the Bug
Neither
ionViewDidEnter
norionModalDidPresent
are triggered modals in v4-beta.12I created a dummy project to reproduce the issue. Per default the dummy project was created with v4-beta.7 and therefore I was able to also test that effectively these events were still triggered in previous version
Steps to Reproduce
Related Code
Expected Behavior
ionViewDidEnter
norionModalDidPresent
should be still triggered in modals tooThe text was updated successfully, but these errors were encountered: