Multiple menu items become active
See original GitHub issueHi😃
- BootstrapVue v1.2.0
- Bootstrap v4b2
- Nuxt v1.0.0- rc11
Nuxt application, For example… Suppose there is a product, product history, cart page.
pages/
├── index.vue
├── cart/
│ └── index.vue
└── products/
├── index.vue
└── history.vue
<b-nav-item-dropdown text="Pages">
<b-dropdown-item to="/products">Products</b-dropdown-item>
<b-dropdown-item to="/cart">Cart</b-dropdown-item>
<b-dropdown-item to="/products/history">History</b-dropdown-item>
</b-nav-item-dropdown>
Access the product page and open the menu. https://monosnap.com/file/HqzPjfcC14537sHzmOYlc1KwEwLHIJ As expected.
Access the cart page and open the menu. https://monosnap.com/file/U66PmxP5IjPPu8fKvWRNZI69ksWF6E As expected.
Access the product history page and open the menu. https://monosnap.com/file/eJ5WnJS3PXhcQdV6NFFSf7otsBX7ZB It is different from expectation. “Products” item should not be active. Should not the active class be an exact match rather than a partial match of the route URL?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Active menu trail for multiple menu item with the same path
When you add a new rule, just choose the option Mark the rule's parent menu item as being "active" on the settings page....
Read more >Wrong active trail with multiple menu items with the same path
When the same path is added multiple times to the menu, then the menu active trail is determined by the first menu link...
Read more >Change Active Menu Item on Scroll with Multiple Menus
The problem arises in that I have multiple menus that are visible at different screen sizes. I'm struggling with a way to change...
Read more >Multiple menu items are being highlighted as current page #18
Issue: When the menu item for a custom post type archive (archive-karriar.php) is active, then also the blog menu item (home.php or index.php...
Read more >Menu Styling | Web Accessibility Initiative (WAI) - W3C
Convey menu items and their states by using color and other styling options. Don't rely on color alone as some users will be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There’s a prop, named
exact
. This is what you should use. Please, read following: https://router.vuejs.org/en/api/router-link.html https://bootstrap-vue.js.org/docs/components/dropdown#component-referenceYour example will be:
You’re welcome! 😃