diff --git a/CHANGELOG.md b/CHANGELOG.md index e78b988..227e2d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ This website is built from the `HEAD` of the `main` branch of the theme reposito Code changes to `main` that are *not* in the latest release: -- N/A +- Fixed: incorrect positioning of clickable area for navigation links on Safari by [@mattxwang] in [#1403] Docs changes made since the latest release: @@ -30,6 +30,7 @@ Docs changes made since the latest release: [@mitchnemirov]: https://github.com/mitchnemirov [#1390]: https://github.com/just-the-docs/just-the-docs/pull/1390 +[#1403]: https://github.com/just-the-docs/just-the-docs/pull/1403 ## Release v0.7.0 diff --git a/assets/js/just-the-docs.js b/assets/js/just-the-docs.js index b7e3655..4f0296d 100644 --- a/assets/js/just-the-docs.js +++ b/assets/js/just-the-docs.js @@ -499,8 +499,7 @@ function navLink() { function scrollNav() { const targetLink = navLink(); if (targetLink) { - const rect = targetLink.getBoundingClientRect(); - document.getElementById('site-nav').scrollBy(0, rect.top - 3*rect.height); + targetLink.scrollIntoView({ block: "center" }); targetLink.removeAttribute('href'); } }