Closed winmodify closed 6 years ago
Same issue.
It conflicts with bootstrap's dropdown because of e.stopPropagation()
call in OffcanvasDropdown. _clickEvent
method.
And I wondered why that class exists at all :)
I can into the same issue and managed to solve it (or make it work) by explicitly adding a display attribute in my css declaration for the shown class on the dropdown-menu:
.navbar-offcanvas .dropdown-menu.shown { display:inline-block; }
Thanks for this @fstockel. Problem is the dropdown won't close when clicking away. And if you have multiple dropdowns, then clicking on one won't close the other if it's already open.
Anyone got a solution for this scenario?
@ChrisInv the workaround provided by @fstockel worked for me. My dropdowns close when I click on another dropdown.
This works for me, although clicking outside the menu does not close the menu which is kind of sketchy imo.
@ChrisInv @scrapewww I'm having the same issue of dropdowns not closing when clicking away (outside the navbar, anywhere else on the page). Have you guys figured this out?
Nevermind, I found a fix. Jame's answer worked for me.
Try below fix - Created pull request #75
e.stopPropagation();
$('.dropdown-toggle').not(this.element).closest('.active').removeClass('active').find('.dropdown-menu').removeClass('shown');
this.dropdown.toggleClass("shown");
- return this.element.parent().toggleClass('active');
+ return this.element.parent().toggleClass('open');
};
Dropdown menu's don't open when you click on them in desktop view. In mobile view it works perfectly.