-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In Dropdown Menu parent element is not clickable #20
Comments
@adialbu How you solve this? |
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:
Here is the long version, explained directly from the author of Bootstrap: https://markdotto.com/2012/02/27/bootstrap-explained-dropdowns/ |
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> |
Thanks!
The text was updated successfully, but these errors were encountered: