Bootstrap Dropdown does not work
See original GitHub issueHi, I’m Trying to use the Dropdown menu in SiteNavi/Index.jsx and it doesn’t seem to be working.
render() {
const pathPrefix =
process.env.NODE_ENV === 'development' ? '' : __PATH_PREFIX__
const { location, title } = this.props
return (
<nav className="navbar navbar-toggleable-md navbar-light bg-faded">
<button className="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span className="navbar-toggler-icon"></span>
</button>
<a className="navbar-brand" href="#">Navbar</a>
<div className="collapse navbar-collapse" id="navbarNavDropdown">
<ul className="navbar-nav">
<li className="nav-item active">
<a className="nav-link" href="#">Home <span className="sr-only">(current)</span></a>
</li>
<li className="nav-item">
<a className="nav-link" href="#">Features</a>
</li>
<li className="nav-item">
<a className="nav-link" href="#">Pricing</a>
</li>
<li className="nav-item dropdown">
<a className="nav-link dropdown-toggle" href="http://example.com" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown link
</a>
<div className="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a className="dropdown-item" href="#">Action</a>
<a className="dropdown-item" href="#">Another action</a>
<a className="dropdown-item" href="#">Something else here</a>
</div>
</li>
</ul>
</div>
</nav>
)
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Bootstrap dropdown does not work - Stack Overflow
I'm starting to experiment with Bootstrap, but I'm not able to get the js dropdown function working the way it does in their...
Read more >[Solved]-Bootstrap dropdown not working - Studytonight
The dropdown should be toggled via data attributes or using javascript. In the above program, we have forgotten to add a data attribute...
Read more >Can't get bootstrap dropdown working - CodeProject
If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are...
Read more >Dropdowns · Bootstrap v5.0
Dropdowns are toggleable, contextual overlays for displaying lists of links and more. They're made interactive with the included Bootstrap dropdown JavaScript ...
Read more >Bootstrap dropdown button not working on click || Solved 2022
In this video, you can easily solve bootstrap dropdown button not working on click .भाई प्लीज सब्सक्राइब करना ना ...
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 Free
Top 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
For those who are still trying to solve this, here’s the solution I used: In
gatsby-node.js
do:Was really racking my brain over this dropdown for a long time and easiest fix for me ended up being upgrading to the latest Bootstrap beta + including Popper.js in html.js (didn’t go the webpack route) as there’s a new dependency on it specifically for dropdowns.
You can read more here: https://getbootstrap.com/docs/4.0/getting-started/introduction/#js