diff --git a/web/src/components/sidebar/SidebarTab.svelte b/web/src/components/sidebar/SidebarTab.svelte index 36b50f6c..87bf8cd0 100644 --- a/web/src/components/sidebar/SidebarTab.svelte +++ b/web/src/components/sidebar/SidebarTab.svelte @@ -4,7 +4,19 @@ export let tabName: string; export let tabLink: string; + let tab: HTMLElement; + $: isTabActive = $page.url.pathname === tabLink; + + const showTab = (e: HTMLElement | undefined) => { + if (e) { + e.scrollIntoView({}); + } + } + + $: if (isTabActive) { + showTab(tab) + } showTab(tab)} > {tabName}