Repository navigation
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v7.x
Current Behavior
ionViewWillEnter is triggered even if no navigation occurs.
If I disable animation on ion-router-oulet and I try to use the swipe gesture on a child page. The ionViewWillEnter event of the parent page will be triggered. Navigation doesn't occur because swipeGesture (due to animation) is disabled is suppose.
<ion-app> <ion-router-outlet [animated]="false"></ion-router-outlet> </ion-app>
Expected Behavior
ionViewWillEnter should not be triggered.
Steps to Reproduce
- Disable animation on ion-router-outlet
- Implement a lifecycle ionViewWillEnter on page 1
- Navigate to page 2
- Make a slide from the left to right (as you want to go back)
- lifecyle ionViewWillEnter will be triggered on page 1 but you remains on page 2
Code Reproduction URL
Ionic Info
Ionic:
Ionic CLI : 7.2.0
Ionic Framework : @ionic/angular 7.8.5
@angular-devkit/build-angular : 17.3.3
@angular-devkit/schematics : 17.3.3
@angular/cli : 17.3.3
@ionic/angular-toolkit : 11.0.1
Capacitor:
Capacitor CLI : 6.0.0
@capacitor/android : 6.0.0
@capacitor/core : 6.0.0
@capacitor/ios : 6.0.0
Cordova:
Cordova CLI : 11.1.0
Cordova Platforms : android 12.0.0
Utility:
cordova-res : not installed globally
native-run : 2.0.1
System:
Android SDK Tools : 26.1.1
ios-sim : 8.0.2
NodeJS : v18.19.1
npm : 10.2.4
OS : macOS Unknown
Xcode : Xcode 15.0 Build version 15A240d
Additional Information
No response
Activity
thetaPC commentedon Sep 11, 2026
Thanks for the report, and sorry for the long wait. Verified: this reproduces on 9.x (9.0.3), in all of Chromium, WebKit and Firefox. Your StackBlitz still runs and reproduces it exactly. It also reproduces in plain JavaScript with no Angular involved, so this sits in Ionic's core package.
It turns out to be broader than the title suggests. It is not only
ionViewWillEnter: page 1 receives a complete enter lifecycle (ionViewWillEnterandionViewDidEnter) and page 2 receives a complete leave lifecycle, and every further swipe fires the whole set again. Swipe-back navigation is also entirely non-functional under[animated]="false", so even a full deliberate swipe will not take you back.The cause is that swipe to go back is a progress-driven animation: Ionic starts the back transition when your finger touches the left edge, then advances or reverses that animation as you drag. With
[animated]="false"no animation is ever created, so the transition completes instantly instead and fires every lifecycle event up front. When you lift your finger there is nothing to finish or reverse, so the router is never told anything and no navigation happens.We have this tracked internally.
fix(nav): defer non-animated swipe back until the gesture completes (i…
ShaneK commentedon Oct 21, 2026
Thanks for the report! The fix for this issue was deployed in v9.0.9!
ionitron-bot commentedon Nov 20, 2026
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.