Merge branch 'patch-1' of https://github.com/thgh/sapper into thgh-patch-1

This commit is contained in:
Rich Harris
2018-02-03 11:45:54 -05:00

View File

@@ -208,7 +208,7 @@ export function init(_target: Node, _routes: Route[]) {
setTimeout(() => {
const { hash, href } = window.location;
const deep_linked = hash && document.querySelector(hash);
const deep_linked = hash && document.getElementById(hash.slice(1));
scroll_history[uid] = deep_linked ?
{ x: 0, y: deep_linked.getBoundingClientRect().top } :
scroll_state();