-
Notifications
You must be signed in to change notification settings - Fork 335
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
Incorrect highlighting of active navigation category #660
Comments
Hmmmmm, I wonder why I don't see this in (e.g.) http://testthat.r-lib.org/news/index.html |
Thanks @hadley! This minimal pkg reproduces the described behavior illustrated in the screens below. Some observations:
|
Rendered site: https://affectionate-edison-98885b.netlify.com/index.html Home icon has sticky highlight behavior here, but doesn't on other sites (e.g. http://pkgdown.r-lib.org) Edit: actually it seems stochastic, may just be a browser session issue. |
There's definitely a bug in the logic in the js function — rather than highlighting all nav sections that match, we need to highlight the one nav that has the longest match. I see this (for example) when rendering the site locally. |
Mark a single tab as active, by looking for the longest match to the path components. If there are multiple matches with equal length, the left-most will be highlighted. Fixes #660
Mark a single tab as active, by looking for the longest match to the path components. If there are multiple matches with equal length, the left-most will be highlighted. Fixes #660
The highlighting of active navigation category on the top navbar at https://giscience.github.io/openrouteservice-r doesn't work for me as expected. In particular, when viewing the vignette "Get started" doesn't get highlighted, while when browsing the man pages both "Reference" and "Home" are set to active. Observed under pkgdown 1.0.0.9000.
The text was updated successfully, but these errors were encountered: