-
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: vue, switching tabs back to previously visited tab pushes a new route #24936
Comments
Thanks, I can reproduce this behavior. The problem here is when we switch tabs back to a previously visited tab, we push a new route onto the stack. So in your application we have the following items inside of the Tab 1 stack before tapping Tab 2:
After going to Tab 2 and then tapping Tab 1 again, we now have the following in the Tab 1 stack:
From here, going back updates the |
Part of the fix here is to do the following in https://github.com/ionic-team/ionic-framework/blob/main/packages/vue-router/src/router.ts#L431: router.go(routeInfo.position - currentHistoryPosition); Due to #24859, this is causing the |
Hi! Thanks for the update ! I will follow this issue ^^ |
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
Current Behavior
When I navigate inside the tabs, my navigation history seems to be broken.
It happens when I use the
mode="ios"
on the<ion-router-outlet>
and the swipe back gesture.I have no errors in the DevTools console.
Expected Behavior
Be able to continue my navigation.
Steps to Reproduce
1 - Click on "level 1" button -> /tabs/tab1/level1
2 - Click on "level 2" button -> /tabs/tab1/level1/level2
3 - Click on "Tab 2" tab button -> /tabs/tab2
3 - Click on "Tab 1" tab button -> /tabs/tab1/level1/level2
4 - Swipe back -> /tabs/tab1/level1
5 - Swipe back -> /tabs/tab1/level1 (it should be /tabs/tab1)
6 - Try to click on "Level 1" button
Video to show the issue:
https://user-images.githubusercontent.com/1482715/158239494-29bf0532-3038-44ae-9300-22dc7d521665.mov
Code Reproduction URL
https://github.com/MimyyK/ionic-tabs-issue
Ionic Info
Ionic:
Ionic CLI : 6.18.2 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/vue 6.0.11
Capacitor:
Capacitor CLI : 3.4.3
@capacitor/android : not installed
@capacitor/core : 3.4.3
@capacitor/ios : not installed
Utility:
cordova-res : not installed globally
native-run : 1.5.0
System:
NodeJS : v16.13.0 (/usr/local/bin/node)
npm : 8.5.3
OS : macOS Monterey
Additional Information
No response
The text was updated successfully, but these errors were encountered: