Skip to content

Commit

Permalink
fix(ui): url updates from link clicks not showing current route in si…
Browse files Browse the repository at this point in the history
…denav (#522)
  • Loading branch information
TristanHoladay authored Nov 1, 2024
1 parent 60d52ee commit 6ae1097
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ui/src/lib/features/navigation/sidebar/component.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,20 @@
return route
})
}
// If link was clicked, updating url, but path is a child route that is currently not renendered
// we need to toggle the submenu to show the child route
function updateOnLinkClicks(path: string) {
for (const route of routes) {
if (path.includes(route.path) && !toggleSubmenus[route.path]) {
toggleSubmenus[route.path] = true
}
}
}
$: if ($page.url.pathname) {
updateOnLinkClicks($page.url.pathname)
}
</script>

<aside
Expand Down

0 comments on commit 6ae1097

Please sign in to comment.