From f012713fc7ec17d195de096b457d73ab5a5bf25d Mon Sep 17 00:00:00 2001 From: Joris van Montfort Date: Tue, 5 Dec 2017 12:36:51 +0100 Subject: [PATCH] Update bootstrap-tabcollapse.js Automatic selection of the first tab when resizing the screen from small to large (showTabs) needs some context to avoid marking the wrong li tag as active. --- bootstrap-tabcollapse.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap-tabcollapse.js b/bootstrap-tabcollapse.js index 76e1279..6e24406 100644 --- a/bootstrap-tabcollapse.js +++ b/bootstrap-tabcollapse.js @@ -80,8 +80,8 @@ $parentLi.append($panelHeading); }); - if (!$('li').hasClass('active')) { - $('li').first().addClass('active') + if (!this.$tabs.find('li').hasClass('active')) { + this.$tabs.find('li').first().addClass('active') } var $panelBodies = this.$accordion.find('.js-tabcollapse-panel-body');