krasimir / navigo

A simple vanilla JavaScript router.
MIT License
2.75k stars 251 forks source link

Anchor adds 3 entries to history #293

Open slezy opened 3 years ago

slezy commented 3 years ago

Hey there,

I came across a bug while using version 8.11.1 when using anchor in url. Navigating to the link with anchor will add 3 entries to history API:

  1. Link with anchor
  2. Link with # but without anchor string
  3. Link with anchor again

So navigating back can become a little tedious...

You can check this bug out in example 111, click the Go to links button and then browser back button.

daun commented 2 years ago

@slezy Have you found a solution to this problem? I tried removing the anchor from the link before navigating, then adding it back after navigating, but the result is the same.