Navbar - close the menu when clicking on a link
See original GitHub issueHey guys, I was wondering how to close the menu when clicking on an item in a navbar. Here is my current code.
b-navbar(toggleable=true,toggle-breakpoint="sm",type='inverse',variant='custom',fixed='top')
b-nav-toggle(target='nav_collapse')
b-collapse#nav_collapse(is-nav)
//- Left Side
b-nav(is-nav-bar)
b-link.navbar-brand(to='/')
img(:src='$root.customer_image_src || "/static/images/fusionware.png"',style='height:28px;')
b-nav-item(to='/') Dashboard
//- Right Side
b-nav.ml-auto(is-nav-bar)
b-nav-item-dropdown(text='Settings',right-alignment=true)
b-dropdown-item(to='/clients') Clients
b-nav-item-dropdown(:text='$root.username',right-alignment=true)
b-dropdown-item(to='/profile') Profile
hr
b-dropdown-item(to='/session/destroy') Logout
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Auto close Navbar when click on link (responsive mode)
this worked for me by adding data-bs-target="#navbarSupportedContent" data-bs-toggle="collapse" to the span tag.inside anchor tag(Nav-Link) ...
Read more >Menu doesn't close after clicking link - Forum | Webflow
A solution is to add an interaction onto each link in the navbar to move the navmenu element 100% to the right. This...
Read more >CLICK OUTSIDE OR ON LINKS TO CLOSE NAVBAR - YouTube
JavaScript - How to Create a Responsive Hamburger Menu with HTML, CSS, & JavaScript · Closing Sidebar by Clicking Outside using Javascript |...
Read more >Closing Sidebar by Clicking Outside using Javascript - YouTube
... Outside using Javascript | Auto Close Sidebar When click on Link ... Sidebar Menu Using Html CSS & Javascript | Dashboard Sidebar...
Read more >How to make nav links close the collapse menu? #36786
I'm using Bootstrap 5 and Next.js and I'm trying to collapse the Navbar menu when I click a link in mobile view. I've...
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
@EdwardBiton Glad it is working for you!
If you run into any issues with the latest release, please open an issue.
I was literally looking for the nav bar not hidding when clicked and found this and saw your comment that this issue is fixed and released just about 2 hours ago. Did an update with v.0.17.0 and worked perfectly. Thanks