Skip to content

Commit

Permalink
[frontend] fix package docs scroll to definition
Browse files Browse the repository at this point in the history
  • Loading branch information
ZenVoich committed Nov 25, 2024
1 parent 85d5f1e commit 001f2e3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/components/package/PackageDocs.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,10 @@
let id = window.location.hash.slice(1);
let el = document.querySelector(`[id="${id}"]`) as HTMLElement;
if (!el) {
console.log(`Definition not found: ${id}`);
return;
}
document.body.scroll({
document.scrollingElement.scroll({
top: el.offsetTop - docHeaderEl.offsetHeight - 10,
behavior: 'smooth',
});
Expand Down

0 comments on commit 001f2e3

Please sign in to comment.