You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is working as intended. When you go from a tabs page to a non-tabs page (your child page), the entire tabs context is considered "leaving". However within the tabs context itself, Tab 1 is still active which is why the lifecycles are not firing on Tab 1 when going to a non-tabs page. You can test this by logging something in the ionViewWillEnter hook on the TabsComponent:
classTabsComponent{ionViewDidEnter(){console.log('view did enter 2');}ionViewWillEnter(){console.log('view will enter3');}}
There's a workaround that might be of interest to you.
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.
Prerequisites
Ionic Framework Version
v7.x
Current Behavior
The ViewWillEnter, ViewDidEnter lifecycle hooks don't fire when I navigate back to the page when popping the stack by pressing the <ion-back-button>
Expected Behavior
According to the documentation those should fire always regardless whether the page was initialized or not.
Steps to Reproduce
Code Reproduction URL
https://stackblitz.com/edit/stackblitz-starters-rzsdv4?file=src%2Fmain.ts%3AL72
Ionic Info
Ionic:
Ionic CLI : 7.2.0
Ionic Framework : @ionic/angular 7.7.4
@angular-devkit/build-angular : 17.3.0
@angular-devkit/schematics : 17.3.0
@angular/cli : 17.3.0
@ionic/angular-toolkit : 11.0.1
Capacitor:
Capacitor CLI : 5.7.2
@capacitor/android : 5.7.2
@capacitor/core : 5.7.2
@capacitor/ios : 5.7.2
Utility:
cordova-res : not installed globally
native-run : 2.0.1
System:
NodeJS : v20.11.1 (/Users/shultiaiev/homebrew/Cellar/node@20/20.11.1_1/bin/node)
npm : 10.2.4
OS : macOS Unknown
Additional Information
No response
The text was updated successfully, but these errors were encountered: