From 3c7d8ab20f9c716652e92065767a5a44ffb21c13 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Fri, 10 Aug 2018 15:00:27 +0200 Subject: [PATCH] fix: workaround replaceState bug in Safari (#2295) Fix #2195 --- src/util/scroll.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/scroll.js b/src/util/scroll.js index cceb03640..1f4e68f30 100644 --- a/src/util/scroll.js +++ b/src/util/scroll.js @@ -8,7 +8,8 @@ const positionStore = Object.create(null) export function setupScroll () { // Fix for #1585 for Firefox - window.history.replaceState({ key: getStateKey() }, '') + // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678 + window.history.replaceState({ key: getStateKey() }, '', window.location.href.replace(window.location.origin, '')) window.addEventListener('popstate', e => { saveScrollPosition() if (e.state && e.state.key) {