-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Closed as not planned
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionAn error in the Docusaurus core causing instability or issues with its executionclosed: duplicateThis issue or pull request already exists in another issue or pull requestThis issue or pull request already exists in another issue or pull request
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I'm using the latest version of Docusaurus.
- I have tried the
npm run clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages. - I have tried creating a repro with https://new.docusaurus.io.
- I have read the console error message carefully (if applicable).
Description
I create a new docusaurus project and add a dropdown item for navbar.
And I find that the dropdown items are all actived on the navbar.
Reproducible demo
https://stackblitz.com/edit/github-rgqq1d?file=docusaurus.config.js
Steps to reproduce
- Init the project with docusaurus v2.1.0
- keep the sidebars config type as
autogenerated( I didn't modify it) - Add 1 dropdown item into navbar items
navbar: {
// ...
items: [
// ...
{
type: "dropdown",
position: "left",
label: "dropdown",
items: [
{
type: "doc",
docId: "tutorial-extras/translate-your-site",
label: "dropdown 1",
},
{
type: "doc",
docId: "tutorial-extras/manage-docs-versions",
label: "dropdown 2",
},
],
},
// ...
],
},Expected behavior
There should be only 1 navbar item actived in the dropdown menu.
Like this:

Actual behavior
All of the dropdown items being actived, including the doc navbar item.
If you add 2 dropdown items, all of the items in both dropdowns are actived.

Your environment
- Public source code: https://stackblitz.com/edit/github-rgqq1d?file=docusaurus.config.js
- Public site URL: -
- Docusaurus version used: 2.1.0
- Environment name and version (e.g. Chrome 89, Node.js 16.4): Chrome 105.0.5195.102, Node.js v16.14.2
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): macOS Monterey 12.5.1
Self-service
- I'd be willing to fix this bug myself.
Metadata
Metadata
Assignees
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionAn error in the Docusaurus core causing instability or issues with its executionclosed: duplicateThis issue or pull request already exists in another issue or pull requestThis issue or pull request already exists in another issue or pull request