From 640c13062ce80b0b94aef9444050d4d3820fb2d8 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Sun, 16 Jul 2017 16:04:37 +0200 Subject: [PATCH] When we show our tabs element use children to be more restrictive --- js/src/tab.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/src/tab.js b/js/src/tab.js index 4fd69c5071..5e5a83118d 100644 --- a/js/src/tab.js +++ b/js/src/tab.js @@ -44,7 +44,7 @@ const Tab = (($) => { const Selector = { DROPDOWN : '.dropdown', NAV_LIST_GROUP : '.nav, .list-group', - ACTIVE : '> .nav-item > .active, > .active', + ACTIVE : '.active', DATA_TOGGLE : '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]', DROPDOWN_TOGGLE : '.dropdown-toggle', DROPDOWN_ACTIVE_CHILD : '> .dropdown-menu .active' @@ -148,7 +148,8 @@ const Tab = (($) => { // private _activate(element, container, callback) { - const active = $(container).find(Selector.ACTIVE)[0] + const activeElements = callback ? $(container).children(Selector.ACTIVE) : $(container).find(Selector.ACTIVE) + const active = activeElements[0] const isTransitioning = callback && Util.supportsTransitionEnd() && (active && $(active).hasClass(ClassName.FADE))