bug: ionic vue main outlet re-rendering tabs when leaving and going back to tabs #22519
Comments
|
Thanks for the issue. Can you reproduce this in an Ionic starter app and provide a link to the GitHub repo? I cannot reproduce this on my end. |
|
Thanks for the issue! This issue has been labeled as Please provide a reproduction with the minimum amount of code required to reproduce the issue. Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed. For a guide on how to create a good reproduction, see our Contributing Guide. |
|
@liamdebeasi I found same issue as well (I just think it is same issue). Here is reproduction demo, use branch bug-4
|
|
@liamdebeasi I have recreated the bug in the tabs demo project: |
|
Thanks for the issue. Can you try the following dev build and let me know if it resolves the issue? |
|
I have created a new project with steps to reproduce. While making this project I also found some strange behaviour that 'fixes' the issue, by playing around with the router entries: |
|
Just as a heads up, I will be merging #22655 soon. The README for the repo in #22519 (comment) actually notes 2 different issues. Method 1 is the issue listed in this thread (which will still exist after merging #22655). Method 2 is a different issue resolved by the PR I linked. Once the PR is merged and shipped, this method should work fine. However, clicking the "Go home" button after following all of the steps will cause the Home page to not show up. This is not a regression, it is just this thread's issue happening again. I plan on taking a look at this issue after the holidays. |
Do you have an approximation of when you think this issue might be resolved? We are planning to release a product using Ionic Framework, but won't be able to if this bug still affects our project. A possible bugfix deadline might give us some insight if we need to implement a temporary tabs navigation replacement. I already wish you Happy Holidays and all the best to you in the year to come! |
Our app is also stuck on this issue, so we are waiting... Thanks! Happy Holidays :) |
|
Hey everyone, I had some time to look at this. The good news is I have a dev build that should fix the issue if anyone would like to test it out: The less good/slightly confusing news is I think I gave some bad advice on how to add child routes in tabs on the docs: https://ionicframework.com/docs/vue/navigation#child-routes-within-tabs.
This seems to be incorrect -- most routes should be written with a shared URL, tab child pages included. So if you have a routing structure that looks like this: {
path: '/tabs',
component: Tabs,
children: [
{
path: '',
redirect: 'tab1'
},
{
path: 'tab1',
component: Tab1,
children: [
{
path: 'child-one',
component: Tab1ChildOne
}
]
}
]
}It should really be written the way Vue Router normally does it, as a sibling route: path: '/tabs',
component: Tabs,
children: [
{
path: '',
redirect: 'tab1'
},
{
path: 'tab1',
component: Tab1
},
{
path: 'tab1/child-one',
component: Tab1ChildOne
}
]
}If you have an app that uses the old child tab setup, you should switch it to the new setup. I am still trying to figure out the best way forward with this new approach (in terms of avoiding breaking changes), but ultimately I think the change is good because it means you can add new pages inside of a tab as you would in a regular Vue 3 app with Vue Router. Let me know if you find any issues with the dev build. Thanks! |
|
I tried that latest build that @liamdebeasi provided but I still have issues when switching routes in Ionic Vue app. Here is example of my router: {
path : '/',
redirect: '/main/tab1',
name : 'Home',
},
{
path : '/signup',
component: Signup,
name : 'Signup',
},
{
path : '/onboarding',
component: Onboarding,
name : 'Onboarding',
},
{
path : '/main',
component: Default,
children : [
{
path : '',
redirect: '/main/tab1',
},
{
path : 'tab1',
component: () => import('@/views/Tab1.vue'),
},
{
path : 'tab2',
component: () => import('@/views/Tab2.vue'),
}]
}Ionic is not hiding content when switching from Onboarding -> Signup -> to any Tabs route( As you can see on image below, I manually added Any suggestions how to fix this issue? |
|
I found issue also. If you are on Dashboard tab, which is active in ion-tab-bar. Then you go on other Tab2(Settings), which is not in ion-tab-bar element. Dashboard tab will contain active, also if is not. This will cause not working ion-tab-button when you want go back to Dashboard. How to reproduce:
Branch bug-5 |
|
@MarekGogol The issue you are describing is something different: #22597. I plan on tackling that after the holidays. edit: See #22597 (comment) for a temporary workaround. |
|
@maleta Can you reproduce this in an Ionic starter app and provide a link to the repo? It's hard to fix the issue without being able to reproduce it myself. |
|
@liamdebeasi I tried to reproduce this on tabs starter app but I couldn't do it. After comparing differences between starter router/components and router/components in my application the only difference was that my There is no documentation on that tag and I removed it at some point earlier when I had this rendering issue first time. I will be adding more nested pages in further days, so I will update this issue if I encounter render issue again. Btw, can you explain when should we use |
|
We should have more documentation on Each view should have one |
|
Hi everyone, apologies for the delay. Here is the game plan for this fix:
Here is an updated dev build if anyone would like to test: Please let me know if you have any questions. Thanks! |
|
Hi @liamdebeasi, I just tested the development builds with the reproduction projects & our own private project and the bugs are no longer present. We will be updating to 5.5.3 as soon as it is released and has passed internal testing. Thank you for the swift communication and regular updates! |
|
Thanks for the issue. This has been resolved via #22807, and a fix will be available in an upcoming release of Ionic Framework. I will be sure to update the docs when this fix ships. |
|
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. |



Bug Report
Ionic version:
[ ] 4.x
[x] 5.x
Current behavior:
Same behaviour as #21885, but with Vue 3.
Expected behavior:
Expect the first tab to redirect to the correct page/component instead of the initial redirected tab page.
Steps to reproduce:
Other information:
See issue: #21885
Ionic info:
The text was updated successfully, but these errors were encountered: