Skip to content

Commit 375671c

Browse files
fix: active nav item set incorrectly in child routes (#7918)
1 parent 23b495b commit 375671c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/next/src/elements/Nav/index.client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export const DefaultNavClient: React.FC = () => {
8888
LinkWithDefault) as typeof LinkWithDefault.default
8989

9090
const LinkElement = Link || 'a'
91-
const activeCollection = pathname.endsWith(href)
91+
const activeCollection = pathname.startsWith(href)
9292

9393
return (
9494
<LinkElement

0 commit comments

Comments
 (0)