Merge pull request #561 from thgh/patch-3

Use getElementById to avoid querySelector error
This commit is contained in:
Rich Harris
2019-02-17 09:45:57 -04:00
committed by GitHub

View File

@@ -158,7 +158,7 @@ export async function navigate(target: Target, id: number, noscroll?: boolean, h
if (hash) {
// scroll is an element id (from a hash), we need to compute y.
const deep_linked = document.querySelector(hash);
const deep_linked = document.getElementById(hash.slice(1));
if (deep_linked) {
scroll = {
@@ -338,4 +338,4 @@ export function load_component(component: ComponentLoader): Promise<{
function detach(node: Node) {
node.parentNode.removeChild(node);
}
}