Open maxgaurav opened 1 year ago
Thanks for the issue! This issue has been labeled as needs reproduction
. This label is added to issues that need a code reproduction.
Please reproduce this issue in an Ionic starter application and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.
If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.
For a guide on how to create a good reproduction, see our Contributing Guide.
I have added the StackBlitz url for the demo in the description and see below as well. Don't forget to turn on the VueDev tools to see the main problem.
https://stackblitz.com/edit/vitejs-vite-yj2kdn?file=src/components/HelloWorld.vue
@liamdebeasi
@liamdebeasi
Any update on this? Did the StackBlitz reproduction help?
Thanks, I can reproduce this. Views 1 and 2 should be unmounted when using routerDirection="root"
because the internal stack history is getting wiped.
Any update on this issue? We need this fixed in our app. Only solution right now is to downgrade to older version where it worked so i wont be able to go back from Homepage after login.
@pivko420 Which version did you downgrade your app to?
I am also waiting for the changes to get fixed but it looks like I may have to end up providing the PR for the fix if there is no activity by next week as this is a significant issue in our app. We have for the time being temporarily closed out the forward navigation flow and made all of them root.
I use "@ionic/vue-router": "6.0.0"
in another older app and it works there.
package.json
"@capacitor/android": "3.4.3",
"@capacitor/app": "1.0.7",
"@capacitor/core": "3.4.3",
"@capacitor/ios": "3.4.3",
"@capacitor/keyboard": "1.2.0",
"@capacitor/splash-screen": "^1.2.2",
"@ionic/vue": "^6.0.0",
"@ionic/vue-router": "^6.0.0",
"vue": "^3.2.1",
"vue-router": "^4.0.0-0",
@pivko420 Thanks for sharing. I have tested the same and confirm that it gets fixed in the old version. I am comparing the changes in the old version versus the one I am facing issue and attempting to create a fix. Once done I will generate a PR.
This is still a issue for all. all navigation is boggy. it shows the right url but the view is wrong. is like old view do not die.
I'm facing same issue with latest @ionic/vue-router 7.7.0. The components is not unmounted, when the stack grow and we have a lot (4-5) of components mounted the ion-router-outlet break. Route is matched but the view show the first component loaded in ion-router-outlet
This solve my issue, the ion-router-outlet seem store only the current route but it works https://github.com/ionic-team/ionic-framework/issues/20597#issuecomment-1216607770
Prerequisites
Ionic Framework Version
v6.x
Current Behavior
Navigating forward mode with at least 3 forward navigation and then triggering root navigation after the third or more forwarded route does not clean up the mapping of the IonRouterOutlet components completely but only removes 1 Component from the stack and pushes the root element.
Expected Behavior
The expected behavior is that the IonRouterOutlet should reset the stack and start from scratch if the direction is root but it does not you can see the screenshots of stacks created in the Steps to Reproduce.
Steps to Reproduce
Here are step by step for current behavior with VueDev Tool screenshots
The initial state starting at DashboardView
Root Navigation to ForumsView
Forward Navigation to TopicView
Another Forward Push to ThreadView
Final Redirection to Dashboard using root as router-direction
Code Reproduction URL
https://stackblitz.com/edit/vitejs-vite-yj2kdn?file=src/components/HelloWorld.vue
Ionic Info
Additional Information
In the IonRouterOutlet component implementation of vue package through debugging i see that action of call unmountLeaving views only being looped once.
I have added the links to the actions below.
https://github.com/ionic-team/ionic-framework/blob/114fe28f3cc9ee52bc5eefa569353f490ab01023/packages/vue-router/src/viewStacks.ts#L190
https://github.com/ionic-team/ionic-framework/blob/main/packages/vue/src/components/IonRouterOutlet.ts#L400