Repository navigation
Description
Ionic Version:
[ ] 4.x
[x] 5.x
Current behavior:
It seems as though doing a router.push with a param, to a view that is currently visible, in this case a search view, will make things get kind of wonky. It's kind of hard to explain but if you go back and forth a couple times, while also doing a router.push to the current page you're on, the navigation just stops working. The URL keeps changing though.
Expected behavior:
proper navigation.
Steps to reproduce:
Using the sample repo below. this may seem convoluted, apologies, bear with me...
home:
1.) enter search term, click search button
search page:
1.) enter search term, click search button ( router.push current route )
2.) click home button
home:
1.) enter new search term, click search button
search page:
1.) click home button,
- url changes but view does not
2.) click about button
3.) on about page click search button, go to back to search page
4.) enter search term and click search
5.) click about button again, url changes but view does not.
6.) none of the buttons on the search page should do anything at this point except change the URL, and there should be about 7 ion-pages in the router outlet stack.
Related code:
Sample Repo:
https://github.com/duncanreid/ion-router-outlet-debug
same comments from above in /src/router/index.ts
Other information:
have tried 5.5.1 and 5.6.0-dev.202012091649.c699e16 for both @ionic/vue and @ionic/vue-router and have the same result.
Ionic info:
Ionic:
Ionic CLI : 6.12.2 (.nvm/versions/node/v12.0.0/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/vue 5.6.0-dev.202012091649.c699e16
Capacitor:
Capacitor CLI : 2.4.4
@capacitor/core : 2.4.4
Utility:
cordova-res : not installed
native-run : not installed
System:
NodeJS : v12.0.0 (.nvm/versions/node/v12.0.0/bin/node)
npm : 6.9.0
OS : macOS Catalina
Activity
liamdebeasi commentedon Dec 9, 2020
Thanks for the issue. From my understanding the issue is happening in the following step:
So you click the about button, the url changes, but the about page does not transition in. Did I get that right?
duncanreid commentedon Dec 9, 2020
It happens a bit before that, I probably could have numbered these steps better and I apologize for that.
home -> search -> search again -> home -> search
on search page:
1.) click home button
The rest was just more clicking around which will disable more of the routing. If you follow those steps in the attached repo, and I realize it seems strange, you should see it.
liamdebeasi commentedon Dec 9, 2020
Thanks! I can reproduce the issue now. I think I was reusing search queries which caused the URLs be the same.
The Home page is being shown, but the "leaving" page is not being hidden, so it appears on top of the Home page. I will work on a fix for this.
[-]bug: vue - ion-router-outlet page transitions stop working[/-][+]bug: ionic vue getting wrong leaving view with dynamic urls[/+]duncanreid commentedon Dec 9, 2020
Excellent. Thank you!
liamdebeasi commentedon Dec 10, 2020
Can you try the following dev build and let me know if it resolves the issue?
duncanreid commentedon Dec 10, 2020
It does, thank you!
liamdebeasi commentedon Dec 10, 2020
Great! I am going to keep this issue open until I can merge in my PR.
virusv commentedon Dec 11, 2020
If I am on a page and try to navigate to a similar page, but with a different parameter, then nothing happens.
https://youtu.be/Ts-hn3q-qug
liamdebeasi commentedon Dec 11, 2020
@virusv Can you provide a GitHub repo that shows this issue happening?
virusv commentedon Dec 11, 2020
Found a message where you have already answered this question, I'm talking about the same problem problem.
#22654 (comment)
I understand that in fact this is the standard behavior for vue-router, but there this was solved by setting the key:
<router-view :key="$route.fullPath"></router-view>liamdebeasi commentedon Dec 11, 2020
Thanks for the clarification. Yeah, this is definitely something we should add to Ionic Vue. I created an issue for this here: #22662.
liamdebeasi commentedon Dec 16, 2020
Thanks for the issue. This has been resolved via #22655, and a fix will be available in an upcoming release of Ionic Framework.
fix(vue): correctly determine leaving view when transitioning to a ne…
ionitron-bot commentedon Jan 15, 2021
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.