alicelieutier/smoothScroll

pushState can push same history

Closed this issue · 3 comments

7cc commented

In Demo, click the first internal link (1. Introduction) twice, then browser history will be
no hash -> #context -> #context

When location.hash and the clicked a-element's hash are the same, just scroll or replaceState would be good.

You're right, I hadn't thought of that :)

Want to make a pull request?

7cc commented

I will try ...! This will be my first pull request. I'm a bit nervous.

Don't worry :)

You can just:

  • update the code on your local repository,
  • push it to github,
  • and then click "pull-request" here on github.

Also link to this issue in the pull request.