Open marceloverdijk opened 4 years ago
Hi @marcelkorpel I had a look and changing $(container).children(SELECTOR_ACTIVE)
to $(container).find(SELECTOR_ACTIVE)
does indeed fix the bug (adds the feature).
Thank you, @RobustProgram, but I did nothing: you mentioned the wrong Marcel. :)
I apologise haha. @marceloverdijk, I was meant to mention you.
This seems to be a reasonable requirement for tabs to support trigger buttons and not sibling elements.
Maybe this is not a real bug report but a feature request.
I'm trying to use Bootstrap Navs with JavaScript behaviour but instead of the tabs and pill I would like to have button toolbar.
Now with a simple toolbar this works:
I'm applying the
nav
andnav-link
classes and the tab behaviour kicks in.Now I wanted to go a but further with a grouped button toolbar like:
The first time I navigate to each tab (using the toolbar buttons) works, but as soon as I want to navigate to a tab the second time it doesn't work.
The reason it does show the tab again is that the navlink anchor in the toolbar was still
.active
. The.active
class was never removed as it is only looking for children under the.nav
div:https://github.com/twbs/bootstrap/blob/v4-dev/js/src/tab.js#L137-L140
Now I wonder if it would as simple to change:
$(container).children(SELECTOR_ACTIVE)
to:
$(container).find(SELECTOR_ACTIVE)
I think it would be nice to be able to navigate tabbed tabbed content with other Bootstrap controls like this.
Bug reports must include: