We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 10b0702 commit 4c0846aCopy full SHA for 4c0846a
packages/zudoku/src/lib/components/navigation/NavigationItem.tsx
@@ -120,6 +120,7 @@ export const NavigationItem = ({
120
case "link":
121
case "custom-page": {
122
const href = item.type === "link" ? item.to : joinUrl(item.path);
123
+ const hasAnchor = href.includes("#");
124
return !href.startsWith("http") ? (
125
<AnchorLink
126
to={{
@@ -131,7 +132,9 @@ export const NavigationItem = ({
131
132
className={navigationListItem({
133
isActive:
134
href ===
- [location.pathname, activeAnchor].filter(Boolean).join("#"),
135
+ (hasAnchor
136
+ ? [location.pathname, activeAnchor].filter(Boolean).join("#")
137
+ : location.pathname),
138
})}
139
onClick={onRequestClose}
140
>
0 commit comments