diff --git a/src/util/scroll.js b/src/util/scroll.js index 9991adaa7..d30c08c93 100644 --- a/src/util/scroll.js +++ b/src/util/scroll.js @@ -7,6 +7,10 @@ import { getStateKey, setStateKey } from './push-state' const positionStore = Object.create(null) export function setupScroll () { + // Prevent browser scroll behavior on History popstate + if ('scrollRestoration' in window.history) { + window.history.scrollRestoration = 'manual' + } // Fix for #1585 for Firefox window.history.replaceState({ key: getStateKey() }, '') window.addEventListener('popstate', e => {