-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: resolve the issue with active menu items when two or more pages start with the same URL (GCOM-1482) #2369
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 706629e The changes in this PR will be included in the next version bump. This PR includes changesets to release 81 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -42,7 +42,7 @@ export function DesktopNavItem(props: DesktopNavItemLinkProps | DesktopNavItemBu | |||
|
|||
const { href, children, sx = [], ...linkProps } = props | |||
|
|||
const active = router.asPath.startsWith((href ?? '').toString()) | |||
const active = router.asPath === (href ?? '').toString() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was that if a child is selected that the parent would be selected as well, so that breaks with this, any suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paales see my latest changes 🙂
Now it activates the parent and only the menu item that exactly matches the router.asPath
.
https://github.com/graphcommerce-org/graphcommerce/pull/2369/files
9e0cec3
to
bab99dc
Compare
…ustomized for a project
GCOM-1482