onokumus/metismenu

Second click on item removes mm-active class

akvaliya opened this issue · 3 comments

version:
@Version 3.0.4

Description

When i click on item second time on the same item mm-active class gets removed. This is unexpected behavior. It's breaks requirements to show active page. When menu item doesn't have sub-menu & user clicks on same menu-item it triggers area-expand behavior. which should not be the case since item doesn't contain sub-menu.

I'm also having this problem. My quick solution is by doing this

$('#metismenu li a').on('click', function(){
    $(this).attr('aria-expanded', 'true')
    $(this).parent().addClass('mm-active')
})

It does not remove active menu when clicking outside the metis menu, which I assume a bug. However for my project it is not bother me at all

@AmirinNS,
I am also facing the same issue in the active parent class. Submenus are collapsing but active class not coming on the parent.
BTW your solutions helped me at this time. But it's not a proper solution.
It also has a problem with the toggle.
Thanks.

@ll,
Problem solved. It was conflicting with another tab.
Thanks.