From be9a2cea4525e24abfcd1c585ce716bb946b98c0 Mon Sep 17 00:00:00 2001 From: Daniel Castillo Date: Fri, 16 Nov 2018 19:56:59 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20anchor=20links=20not=20upd?= =?UTF-8?q?ating=20current=20URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../@vuepress/core/lib/app/root-mixins/updateLoadingState.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/@vuepress/core/lib/app/root-mixins/updateLoadingState.js b/packages/@vuepress/core/lib/app/root-mixins/updateLoadingState.js index acd35eb84a..5257437922 100644 --- a/packages/@vuepress/core/lib/app/root-mixins/updateLoadingState.js +++ b/packages/@vuepress/core/lib/app/root-mixins/updateLoadingState.js @@ -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,