Skip to content
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

fix: make proper highlighting doc link if no sidebar #5317

Merged

Conversation

hamzahamidi
Copy link
Contributor

@hamzahamidi hamzahamidi commented Aug 7, 2021

Motivation

Closes #5310

Have you read the Contributing Guidelines on pull requests?

(Write your answer here.)

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

Close All navbar items without sidebar are active facebook#5310
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Aug 7, 2021
@netlify
Copy link

netlify bot commented Aug 7, 2021

✔️ [V2]
Built without sensitive environment variables

🔨 Explore the source changes: c113b0c

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/610ef6e9e2a8670008358b62

😎 Browse the preview: https://deploy-preview-5317--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Aug 7, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 82
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-5317--docusaurus-2.netlify.app/

@lex111 lex111 changed the title fix: All navbar items without sidebar are active fix: make proper highlighting doc link if no sidebar Aug 7, 2021
@lex111 lex111 added the pr: bug fix This PR fixes a bug in a past release. label Aug 7, 2021
…arItem.tsx

Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
@@ -56,7 +56,7 @@ export default function DocNavbarItem({
{...props}
className={clsx(props.className, {
[activeDocInfimaClassName]:
activeDoc && activeDoc.sidebar === doc.sidebar,
activeDoc?.sidebar && activeDoc.sidebar === doc.sidebar,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this case navbar items without sidebar always will be inactive?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it would work fine because it's already the default behavior for a link to be active when we are on the link target page. We only need this additional class to enable the "tab-like" behavior.

@slorber
Copy link
Collaborator

slorber commented Aug 10, 2021

👍

@slorber slorber merged commit 39faf44 into facebook:master Aug 10, 2021
@hamzahamidi hamzahamidi deleted the fix/navbar-items-without-sidebars branch August 10, 2021 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

All navbar items without sidebar are active
5 participants