Skip to content

Commit

Permalink
fix: anchor links not updating current URL (closes #1011) (#1014)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcastil authored and ulivz committed Nov 17, 2018
1 parent 2b40e7e commit 1a87017
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default {
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault()
history.pushState(history.state, document.title, e.target.href)
window.scroll({
top: e.target.offsetTop - 75,
left: 0,
Expand Down

0 comments on commit 1a87017

Please sign in to comment.