Comments (3)
@adialbu How you solve this?
from bootstrap-5-wordpress-navbar-walker.
On Bootstrap the parent item of a dropdown menu is, by design, clickable only to open the dropdown and not as a link.
Here is the short version of why:
In Bootstrap, we use a mix of both hover and click though–hover for tooltips and popovers, clicks for dropdowns and more. What it really boils down to is user intent. The purpose of a hover state is to indicate something is clickable (underlined text) or to provide some quick information (full URL in a tooltip). The purpose of a click is to actually do something, to take an explicit action. Opening a dropdown is an explicit action and should only happen on click.
Here is the long version, explained directly from the author of Bootstrap: https://markdotto.com/2012/02/27/bootstrap-explained-dropdowns/
from bootstrap-5-wordpress-navbar-walker.
I solved it with the code below
<script type="text/javascript"> //Fix bootstrap dropdown parent click let clicked = 0; document.querySelector('.dropdown-toggle').addEventListener('click',(e)=>{ clicked++; if(clicked > 1 && e.target.classList.contains('show')){ location.href = e.target.href clicked = 0; } }) </script>from bootstrap-5-wordpress-navbar-walker.
Related Issues (20)
- Starter Content Nav Menus
- 2nd level submenu not working HOT 1
- depth = 3 seems not to work HOT 2
- do not work sub menu in depth 3 HOT 9
- Wordpress 5.8 HOT 3
- Multiple menu items are being highlighted as current page HOT 17
- Level 2 Item not showing if it has children at level 3. HOT 28
- how to add naavbar button shutdown?
- Navbar accessibility using keyboard navigation for dropdown (tab and shift+tab)
- Bootstrap 5.1.3 HOT 1
- Dropdown
- Clickable parent HOT 1
- bootstrap-5-wordpress-navbar-walker - is there any support for multilevel menu HOT 2
- Navbar also works with mouseover? HOT 1
- Dropdown ul has inline style css HOT 2
- For Smartphone hamburger not found
- Is the version 1.3.4 of this navbar walker compatible with Boostrap 5.3.2 ? HOT 1
- WordPress standard
- Anchor tag navigation issue on single page websites - with Hamburger
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootstrap-5-wordpress-navbar-walker.