Ionic-framework: bug: onPageWillEnter will not fire for first tab view

Created on 19 Feb 2016  路  4Comments  路  Source: ionic-team/ionic-framework

Type: bug

Ionic Version: 2.x

Platform: android 4.4 webview

Please check forum: https://forum.ionicframework.com/t/onpagewillenter-onpagedidenter-not-fired/40845/4

efishman's comment summarises correctly:

Hello all,

I have figured it out - as Tom said, it occurs on tabbed project - what happens actually is that the TABBED page is actually the one that the onPageWlllEnter (or DidEnter) is being called on - and it DOES NOT "bubble" to the ACTIVE page (the current tab) - I don't know if it is a bug or by design - but now - as I have implemented the method in the TABBED page, I can easily "notify" the active tab page about it having the focus again, and invoking any logic on that page manually.

Regards,
Eddy

Either documentation should be amended or the first tab page should do a onPageWillEnter as per documentation on Page lifecycle, right?

Regards

Tom

Most helpful comment

Dear @adamdbradley
I managed to download your example and make it work.
I also updated to beta 1.

The bug/feature is still there - and is perfectly demonstrated by pressing the "chat" icon which opens a modal on top of the tabs page.
After closing the chat - only the Main tabs page (tabs.html) prints out its "WillEnter" / "DidEnter" events - while the "active" page (Tab1Page1) does not get any events although it becomes "active" again.
Again - as stated in my note - I don't know if this is a bug or by design - I just pointed it out.
I of course worked around this - and on entering the surrounding Tabs page again - broadcasted an event to the "Active" page so code done in it's "WillEnter" event will be executed every time the Tab1Page1 becomes active.
I think it should have been done by ionic - the active tab page should have also received the events.

Regards,
Eddy

All 4 comments

Sorry, either I'm not fully understanding the issue, or it may have already been fixed, but I'm not able to replicate lifecycle events not firing. Have you tried updating to beta1?

Would you be able to look at this example and point out which console logs would not be working for you? https://github.com/driftyco/ionic/blob/2.0/ionic/components/tabs/test/advanced/index.ts

Thanks

Dear Adam,
Thx for reverting. I cant replicate anymore in my own app (embarrassing). Couldnt get the example you gave to work properly (which I guess we shouldnt make an issue either). Also need to update to beta (now apparently running alpha-57).
Tom

Dear @adamdbradley
I managed to download your example and make it work.
I also updated to beta 1.

The bug/feature is still there - and is perfectly demonstrated by pressing the "chat" icon which opens a modal on top of the tabs page.
After closing the chat - only the Main tabs page (tabs.html) prints out its "WillEnter" / "DidEnter" events - while the "active" page (Tab1Page1) does not get any events although it becomes "active" again.
Again - as stated in my note - I don't know if this is a bug or by design - I just pointed it out.
I of course worked around this - and on entering the surrounding Tabs page again - broadcasted an event to the "Active" page so code done in it's "WillEnter" event will be executed every time the Tab1Page1 becomes active.
I think it should have been done by ionic - the active tab page should have also received the events.

Regards,
Eddy

It is still happening, does anyone have a decent workaround for this? I am pretty sure that it's not be design from how I see the tabs behave with other events.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

manucorporat picture manucorporat  路  3Comments

GeorgeAnanthSoosai picture GeorgeAnanthSoosai  路  3Comments

brandyscarney picture brandyscarney  路  3Comments

BilelKrichen picture BilelKrichen  路  3Comments

RobFerguson picture RobFerguson  路  3Comments