mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-22 07:05:24 +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) {
|
if (hash) {
|
||||||
// scroll is an element id (from a hash), we need to compute y.
|
// 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) {
|
if (deep_linked) {
|
||||||
scroll = {
|
scroll = {
|
||||||
|
|||||||
Reference in New Issue
Block a user