Skip to content

Commit de3d7c9

Browse files
fix: prevents duplicate active nav indicators (#7943)
1 parent 570422f commit de3d7c9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

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

9090
const LinkElement = Link || 'a'
91-
const activeCollection = pathname.startsWith(href)
91+
const activeCollection =
92+
pathname.startsWith(href) && ['/', undefined].includes(pathname[href.length])
9293

9394
return (
9495
<LinkElement

0 commit comments

Comments
 (0)