Repository navigation
.show class leaked on navlink #28118
Copy link
Copy link
Closed
Description
Activity
Yep I think too, maybe @MartijnCuppens wants to fix that ?
Reacted by Martijn Cuppens@MartijnCuppens: any progress with this?
I forgot about this, I'll have a look at it now and check if we can write a test to prevent this from happening.
Reverting https://github.com/twbs/bootstrap/pull/27533/files#diff-02a6d2619ddbbd65ac148de3377674eeL174 would indeed "fix" this issue, but there's another issue here: we shouldn't add the
.showclass on the.nav-linkin any case.Let's analyse these lines:
Lines 111 to 133 in f134d4b
this._activate( this._element, listElement ) const complete = () => { const hiddenEvent = $.Event(Event.HIDDEN, { relatedTarget: this._element }) const shownEvent = $.Event(Event.SHOWN, { relatedTarget: previous }) $(previous).trigger(hiddenEvent) $(this._element).trigger(shownEvent) } if (target) { this._activate(target, target.parentNode, complete) } else { complete() } The
_activatefunction is triggered on.tab-paneand.nav-link. In L111 the show class will be added to the target.tab-paneand in L130 the class will be added to the.nav-link. Not sure why.@Johann-S could you help here?
Bootstrap 4.2.1: on every dynamic tabbed interface, whenever I click on a
.tablinkthe classes.active .showare properly added to the new item but the.showclass is not removed from the previously active item. If this is an issue, it seems to be a regression because with bootstrap 4.1.3 all is working as expected.Here is a MWE using pills; just inspect Home or Profile while switching between the two panes: https://jsfiddle.net/4oy92hmx/