fix: update active state logic to include nested routes in navigation components

This commit is contained in:
Sam Chau
2025-11-09 07:11:12 +11:00
parent 78f33aae43
commit 1181729da5
2 changed files with 2 additions and 2 deletions

View File

@@ -11,7 +11,7 @@
let { label, href, isOpen, hasItems, onToggle }: Props = $props();
const isActive = $derived($page.url.pathname === href);
const isActive = $derived($page.url.pathname === href || $page.url.pathname.startsWith(href + '/'));
</script>
<div class="group/header flex items-center">

View File

@@ -8,7 +8,7 @@
let { label, href }: Props = $props();
const isActive = $derived($page.url.pathname === href);
const isActive = $derived($page.url.pathname === href || $page.url.pathname.startsWith(href + '/'));
</script>
<a