Skip to content

Commit db42f41

Browse files
committed
fix: workaround replaceState bug in Safari
Fix #2195
1 parent 373d613 commit db42f41

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/util/scroll.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const positionStore = Object.create(null)
88

99
export function setupScroll () {
1010
// Fix for #1585 for Firefox
11-
window.history.replaceState({ key: getStateKey() }, '')
11+
// Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678
12+
window.history.replaceState({ key: getStateKey() }, '', window.location.href.replace(window.location.origin, ''))
1213
window.addEventListener('popstate', e => {
1314
saveScrollPosition()
1415
if (e.state && e.state.key) {

0 commit comments

Comments
 (0)