-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
fix(router): don't use replace on every route when going back #2464
Conversation
Cloudflare Pages deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your willingness to fix this! However, this doesn't fix the issue:
- This reintroduces the situation described in the comment: if you click on the link of the readme of this repo to load the hosted instance and then click in the back button, you will be redirected back to GitHub, while we want to hack all the back navigation inside the application (of course not in the browser's buttons, just in the app's).
- There's a reason why Vue Router has its own back function and we should not be more "clever". I believe this approach kills history routing and resolve hooks from Vue Router.
In either case, an appropiate fix would be to do nothing or perform the back on the logic truthiness, and only replace with index on falsyness. Can you try that and test if it fits all the conditions stated above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works perfectly now! Can you please reintroduce the deleted comment about the transition though?
Quality Gate passedIssues Measures |
@ToastKiste21 Thank you very much for your contribution and finding that replace was the issue! |
Related Issue: #2403
Summary
This merge request resolves a navigation issue where users were unable to traverse the entire navigation history using the back button in the application's sidebar. The problem stemmed from overriding the router.back method with router.replace, which disrupted the history stack and prevented Vue Router from accurately tracking the history length.