mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-11 19:04:30 +00:00
Merge pull request #561 from thgh/patch-3
Use getElementById to avoid querySelector error
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user