Skip to content
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 #2607): Fix router.back in abstract mode when 2 consecutive same routes appear in history stack #2771

Merged
merged 2 commits into from
Jul 5, 2019

Conversation

Domino9697
Copy link
Contributor

This PR provides a fix to the issue #2607.

Reproduction link

https://jsfiddle.net/Rocka/bhu5vkn8/3/

In abstract mode, if you try to navigate through your history with the same routes appearing consecutively in your stack history, the history index remains unchanged.

In History or Hash mode, this issue does not appear because history navigation is handled by the browser and not by vue-router. In all modes, we do not want to re-render a page if the current route and the next route are identical. However, in the case of abstract mode, we still need to update the history index whenever the current and next routes are the same since AbstractHistory handles its own history stack.

@Domino9697 Domino9697 changed the title (fix #2607[, #2607]): Fix router.back in abstract mode when 2 consecutive same routes appear in history stack (fix #2607): Fix router.back in abstract mode when 2 consecutive same routes appear in history stack May 17, 2019
Domino9697 and others added 2 commits July 5, 2019 15:17
Fix abstract mode's router.back() when 2 consecutive same routes appear in the history stack array

fix vuejs#2607
@posva posva force-pushed the fix-abstract-history-navigation branch from 26af63f to a5af53f Compare July 5, 2019 13:17
@posva
Copy link
Member

posva commented Jul 5, 2019

I rebased against dev and adapted the code to use an Error object

@posva posva merged commit 8910979 into vuejs:dev Jul 5, 2019
@vue-bot
Copy link

vue-bot commented Jul 5, 2019

Hey @Domino9697, thank you for your time and effort spent on this PR, contributions like yours help make Vue better for everyone. Cheers! 💚

@Domino9697
Copy link
Contributor Author

Thank you @posva !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants