From 12613638a4cea74b5f205c6dfa314e96fbd9817a Mon Sep 17 00:00:00 2001 From: Wz Date: Sat, 9 May 2020 18:07:25 +0800 Subject: [PATCH] feat(scroll): use manual scrollRestoration with scrollBehavior (#1814) --- src/util/scroll.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util/scroll.js b/src/util/scroll.js index c6c055a97..d2588fec4 100644 --- a/src/util/scroll.js +++ b/src/util/scroll.js @@ -8,6 +8,10 @@ import { extend } from './misc' 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 // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678 // Fix for #2774 Support for apps loaded from Windows file shares not mapped to network drives: replaced location.origin with