The Wayback Machine - https://web.archive.org/web/20200619173514/https://github.com/twbs/bootstrap/issues/28638
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrollspy documentation regarding anchor class #28638

Open
etsauer opened this issue Apr 10, 2019 · 1 comment
Open

Scrollspy documentation regarding anchor class #28638

etsauer opened this issue Apr 10, 2019 · 1 comment
Labels

Comments

@etsauer
Copy link

@etsauer etsauer commented Apr 10, 2019

OS: Fedora 29
Browser: Chrome

The Scrollspy documentation has a list of requirements to "activate" the feature. One requirement that appears to be missing is the presence of class="nav-link" in all anchor tags in your nav component. I think this is important to mention, as it took quite a bit of trial and error to discover this while trying to enable scrollspy on an auto-generated nav component.

@XhmikosR XhmikosR added the v4 label Apr 15, 2019
@tmorehouse
Copy link
Contributor

@tmorehouse tmorehouse commented Apr 17, 2019

It also doesn't appear to support nested UL/LI markup as well,

<ul class "nav">
  <li class="nav-item"><a href="#foo" class="nav-link">Foo</a></li>
  <li class="nav-item"> <!-- this doesn't get the .active class when sub items are .active -->
    <a href="#bar" class="nav-link">Bar</a>
    <ul class="nav">
      <li class="nav-item"><a href="#bar-a" class="nav-link">Bar A</a></li>
      <li class="nav-item"><a href="#bar-b" class="nav-link">Bar B</a></li>
    </ul>
  </li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can’t perform that action at this time.