Repository navigation
Tabs/Scrollspy/.nav/.list-group/.active independent of markup (<nav>, .nav-item, <li> etc...) - #21807
Conversation
…f nav-item class or of the markup elements (li, nav, div etc…)
…dd an example with sub-nabs
| .nav-link { | ||
| @include border-radius($nav-pills-border-radius); | ||
| } | ||
|
|
There was a problem hiding this comment.
Not 100% sure but this change breaks navs with dropdowns.
There was a problem hiding this comment.
Are you talking about this one?
&.active {
color: $nav-pills-active-link-color;
cursor: default;
background-color: $nav-pills-active-link-bg;
}Or that one?
.nav-link {
@include border-radius($nav-pills-border-radius);
}For info the second one wasn't modified in this PR.
Anyway in both cases I can't reproduce the problem you are reporting regarding navs with dropdown.
Could you clarify in which way it breaks it ? Or point me to an exemple in the docs that is broken? Or provide more details?
There was a problem hiding this comment.
My bad, I see what you means now. I fixed it here. Thanks !
|
Maybe @vanduynslagerp can rebase his branch (instead of a merge) to fix the build issue |
|
Sorry about that @vanduynslagerp but can you update your branch again 😄 thank you 👍 |
|
Done |
|
Thank I'll review your PR asap 👍 |
There was a problem hiding this comment.
Can you update this file : https://github.com/twbs/bootstrap/blob/v4-dev/js/tests/visual/tab.html#L199
Because in your branch it doesn't work the same as v4-dev
Sure. I somehow always forget the visual tests. I'll do it tonight (EST time). |
|
Sorry for the lack of details, the visual test about tabs with list group doesn't work same as |
| </div> | ||
|
|
||
| {% highlight html %} | ||
| <div class="row"> |
There was a problem hiding this comment.
I think you can remove this div (<div class="row">) from your example
There was a problem hiding this comment.
Do you mean to make the sample code more concise ?
There was a problem hiding this comment.
Ok. Then I'll remove <div class="col-4"> as well I suppose. I thought it would be helpful for the user to see how to make the vertical menu with the grid. But thinking about it now, it's true it makes the sample bigger and it's not really the place for that anyway. I'll change it tonight
| The ScrollSpy plugin also works with nested `.nav`s. If a sub-`.nav` is `.active`, it's parents will also be `.active`. Scroll the area next to the navbar and watch the active class change. | ||
|
|
||
| Scrollspy currently requires the use of a [Bootstrap nav component]({{ site.baseurl }}/components/navs/) for proper highlighting of active links. | ||
| <div class="bd-example"> |
There was a problem hiding this comment.
I cannot see this example working because they aren't scroll and when I scroll the main scroll no active class added
There was a problem hiding this comment.
Works for me on Safari, Chrome and Firefox.
The scroll is set by the class .scrollspy-example-2 I added to docs/assets/scss/_component-examples.scss. I guess you have to recompile the docs with grunt docs.
There was a problem hiding this comment.
Yes I thought about it after my comment my bad 👍
|
|
||
| The ScrollSpy plugin also works with a `.list-group`. Scroll the area next to the list group and watch the active class change. | ||
|
|
||
| <div class="bd-example"> |
There was a problem hiding this comment.
Same with this example no active class added
Shorten some examples
|
I updated the visuals tests and removed the A few explanation regarding the reversal of your code.
In the tabs visual the JS of my PR was actually working (the |
|
Thank you @vanduynslagerp 👍 I'll review your last changes later |
|
Somehow you must not have the right version of the code. The scroll is created by the class here. So it seems you don't have a local documentation generated from the code of my branch. Make sure you have pulled all the code from my branch then run:
|
|
I was up to date before you last commit and I did the grunt command you said. |
|
Everything is fine but your branch is not up to date @vanduynslagerp |




Fixes #20451, fixes #19736, fixes #21223, fixes #18566, fixes #18409, fixes #20620, fixes #20156.
The intent in v4 is to support two type of markup for
.nav,tab,scrollspy:<ul>markup":<nav>markup":This PR provide the necessary fixes:
.nav-itemor<li>anymore.active.nav-linkfor both markup broken here.nav-justifiedfor both markup that was broken for "<nav>markup".nav-fillfor both markup that was broken for "<nav>markup"scrollspydocs to mention both markup and that.nav-linkreceives the.activeclassscrollspyexample in the docs with nested.nav-links<nav>and<ul>markup.nav-itemor<li>,<a>etc...list-groupwith tabs in a more simple way with less specific class dependenciesIn addition it adds the support of
scrollspyandtabto'list-group(per request in #20620):tabplugin to support.list-grouptabexample and documentation inlist-grouppagescrollspyplugin to support.list-groupscrollspyexample and documentationBoth
tabandscrollspyplugin now only depends on:.navor'list-groupclass on the parent or sub-parent in case of nested navs.nav-linkor.list-group-itemanywhere within to add the.active