Skip to content

Commit

Permalink
fix: collapse sidebar location match
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Aug 14, 2024
1 parent a20ac60 commit 1d02a16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/thin-ants-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vocs": patch
---

Fixed location match for collapsed sidebars.
2 changes: 1 addition & 1 deletion src/app/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function SidebarItem(props: {
const itemRef = useRef<HTMLElement>(null)

const { pathname } = useLocation()
const match = useMatch(item.link ?? '')
const match = useMatch(item.link || '')

const hasActiveChildItem = useMemo(
() => (item.items ? Boolean(getActiveChildItem(item.items, pathname)) : false),
Expand Down

0 comments on commit 1d02a16

Please sign in to comment.