Skip to content

Commit

Permalink
fix: workaround replaceState bug in Safari
Browse files Browse the repository at this point in the history
Fix #2195
  • Loading branch information
posva committed Jul 12, 2018
1 parent 373d613 commit db42f41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/util/scroll.js
Expand Up @@ -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) {
Expand Down

0 comments on commit db42f41

Please sign in to comment.