question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: vue, switching tabs back to previously visited tab pushes a new route

See original GitHub issue

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
liamdebeasicommented, Apr 1, 2022

Hey there, I wanted to provide a quick update. The underlying issue for this bug is the same as https://github.com/ionic-team/ionic-framework/issues/24303.

I am currently working on a fix for this, but I am going to merge this thread with #24303. Any future updates will be provided on that thread. Thanks!

1reaction
liamdebeasicommented, Mar 14, 2022

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 https://github.com/ionic-team/ionic-framework/issues/24859, this is causing the ion-back-button to disappear when going back. #24859 should be resolved first.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Delay in loading the response when I am switching between ...
I am switching between the tabs through routing of vue js as above code (case1, case2) and each tab is again calling that...
Read more >
Ionic nested routes and tabs not working as expected
From childPage 2 we push a route which doesn't belong to any tab, and clicking ion-back-button work fine and we can get back...
Read more >
Tabs component - Vuetify
The v-tabs component is used for hiding content behind a selectable item. This can also be used as a pseudo-navigation for a page,...
Read more >
Linking to a Specific Tab in Vuetify.js | by Jarek Lipski - Medium
The problem with using this number to identify a tab is that the order of tabs can change if we add any new...
Read more >
Content Jumping (and How To Avoid It) | CSS-Tricks
Few things are as annoying on the web as having the page layout unexpectedly change or shift while you're trying to view or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found