-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Allow ScrollSpy to work for List Groups #13050
Comments
This is a great idea. I wanted to use scrollspy with list-group today, but found out that it wasn't possible. |
i wonder if we would break the internet if we changed it from |
my feedback is: not crazy about adding an option. I do think it would be cool if this worked with list-groups though. also, would be cool to get a pr from you… :) my ideal solution would be to come up with something which worked for both scenarios (without breaking backwards compat)… possible? |
Great to hear from a core team member! My initial question was simply to find out if it was a good idea. Since you like the idea, PR on its way. I'll noodle a bit on how to support both without an option, I bet it could be done with a little inspection of the DOM. Expect a PR in the next couple hours. |
Probably a v4 thing for the scrollspy which simply targets either the immediate children of a particular element (e.g., all |
Calling this a nice to have, but not something we'll commit to for v3.x. |
+1 for the idea |
I'm implementing a side navigation bar using a list group with linked items. Looks something like this:
ScrollSpy currently only works with
.nav
elements containing links insideli
elements. I propose we also support list groups. List groups support active links, which makes them a good candidate for navigation elements, therefore ScrollSpy should support them.I have an idea about how to do this, but it's really rough, so I'm just going to describe it here instead making a full pull request. If people think the idea is good, I'll write it up and create the pull request.
We could either try and detect a list group, or allow passing an option to specify list-group mode. I'm going with the latter.
This would require implementing the selector something like this:
and the activation code like this:
Interestingly enough the code is simpler for the list group case.
What does everyone think? Should I flesh this out into a pull request?
The text was updated successfully, but these errors were encountered: