tabs.js _activate is too restrictive
Created by: mnlipp
I have a slightly more complicated tab layout than usual. The tab has an additional icon.
<li class="nav-item text-nowrap" data-portlet-tab="portlet-tab-2">
<span class="nav-link">
<a id="portlet-tab-2-tab" data-toggle="tab" href="#portlet-tab-2-pane" role="tab" class="active show" aria-selected="true">Hello World</a>
<a href="#" class="fa fa-times ml-1 portlet-tab-close"></a>
</span>
</li>
This would work if the active
class was properly removed from the tab. But the selector for active
is too restrictive.
if (container.nodeName === 'UL') {
activeElements = $$$1(container).find(Selector.ACTIVE_UL);
} else {
activeElements = $$$1(container).children(Selector.ACTIVE);
}
The element with the active
class (the one with the data-toggle
) must be an immediate child of the UL, but in my case, it isn't. I don't think that this very restrictive rule is necessary, the active element can also be a grand-child (as in my case) or even further down in the hierarchy without causing problems.