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

Manually changing the URL doesn't trigger a navigation in Hash mode #346

Closed
posva opened this issue Jul 2, 2020 · 0 comments
Closed

Manually changing the URL doesn't trigger a navigation in Hash mode #346

posva opened this issue Jul 2, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@posva
Copy link
Member

posva commented Jul 2, 2020

from #345


Currently, the hash mode is based of the html5 history because:

  • more consistent across browsers compared to onhashchange
  • all supported browsers support it
  • Allows storing a state to guess the navigation direction and correctly cancel in when a navigation guard does next(false) and the user clicked the back/forward button. Note in vue router v3 it just pushes a new entry, erasing the history

This creates an empty navigation without that information when

  • Clicking on a regular link with a hash
  • Manually changing the url

I think we could change the line at https://github.com/vuejs/vue-router-next/blob/master/src/history/html5.ts#L75 to trigger a regular navigation as if the user called router.push. We should check if this doesn't break any behavior and add tests

@posva posva added the enhancement New feature or request label Jul 2, 2020
@posva posva closed this as completed in 93891ab Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant