-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
active matching to multiple sub paths #8018
Comments
Agree there's something weird here.
If the sidebar of the browsed doc is active, we should add a custom className instead of marking the doc navbar item as active (this is what enables a tab-like navigation, cf the |
Note: maybe you would want "docs" to remain highlighted when browsing any doc? (ie have a "tab-like" highlighting pattern? 🤷♂️ Not having any navbar item highlighted could also be confusing for users, as they don't know in which part of the site they are currently? |
I think we just want to be able to put a regex pattern on doc-type items too. Currently, if we put a |
That's a solid point. I think for our case (if we could setup our own regex matching) we could have the |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
When using versioned docs with explicit paths (v10 docs are at trpc.io/v10/introduction, v9 at trpc.io/v9/introduction etc), every single sub route of /v10 is active matched from the navbar.
We have some items in the navbar that are doc items (introduction, quickstart and usage with next.js) that are all being marked as active when browsing the documentation.
Reproducible demo
https://github.com/trpc/trpc/tree/next/www
Steps to reproduce
Expected behavior
If clicking quickstart, only that should be marked active etc.
Actual behavior
all subroutes under
/v10/*
or/v9/*
is marked active.Your environment
Self-service
The text was updated successfully, but these errors were encountered: