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

Sidebar categories don't autocollapse when navigating via paginator #7387

Closed
2 tasks done
pranabdas opened this issue May 10, 2022 · 1 comment · Fixed by #7411
Closed
2 tasks done

Sidebar categories don't autocollapse when navigating via paginator #7387

pranabdas opened this issue May 10, 2022 · 1 comment · Fixed by #7411
Labels
bug An error in the Docusaurus core causing instability or issues with its execution domain: theme Related to the default theme components

Comments

@pranabdas
Copy link
Contributor

pranabdas commented May 10, 2022

Have you read the Contributing Guidelines on issues?

Motivation

When autoCollapseCategories is set to true, I think it would be consistent to collapse all the non-current sidebar categories leaving only one actively open category. This is what happens when we open a new sidebar category by clicking on the sidebar. However, if we trigger open a new category via PaginatorNavLink button, it does not trigger collapse for the previously opened categories.

For example, let's open https://docusaurus.io/docs/typescript-support, which is the last page of Getting Started category. Now clicking on the next category i.e., Guides in the sidebar would collapse the Getting Started and open Guides. Now, go back to previous page, scroll down to the bottom of the page, and click the Next button, it will open Guides category in the sidebar but also leave the Getting Started open.

Self-service

  • I'd be willing to do some initial work on this proposal myself.
@pranabdas pranabdas added proposal This issue is a proposal, usually non-trivial change status: needs triage This issue has not been triaged by maintainers labels May 10, 2022
@Josh-Cena Josh-Cena added feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. domain: theme Related to the default theme components bug An error in the Docusaurus core causing instability or issues with its execution and removed proposal This issue is a proposal, usually non-trivial change status: needs triage This issue has not been triaged by maintainers feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. labels May 10, 2022
@Josh-Cena
Copy link
Collaborator

It's a bug. We should always leave only one category open.

The entire logic around this is a bit messy. I don't even fully know what's going on...

@Josh-Cena Josh-Cena changed the title Auto collapse sidebar categories when navigating via PaginatorNavLink Sidebar categories don't autocollapse when navigating via paginator May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution domain: theme Related to the default theme components
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants