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

fix scrollspy for targets within tabs #11453

Merged
merged 2 commits into from
Mar 14, 2014
Merged

fix scrollspy for targets within tabs #11453

merged 2 commits into from
Mar 14, 2014

Conversation

moodyroto
Copy link
Contributor

Scrollspy target in tab content does not work properly. Calling .parents('.active') will return all parents with an active class (including the tab pane). Changing this line to .parentsUntil(this.options.target, '.active') should resolve the issue. This will scope the query to only search for active elements inside the scrollspy target.

Example of the issue. Scroll down on the home tab and you will see the tab pane disappear.

Scrollspy target in tab content does not work properly. Calling .parents('.active') will return all parents with an active class (including the tab pane). Changing this line to .parentsUntil(this.options.target, '.active') should resolve the issue. This will scope the query to only search for active elements inside the scrollspy target.
@fat
Copy link
Member

fat commented Nov 15, 2013

is it possible to add a unit test for this? that would be rad

@cvrebert cvrebert modified the milestones: v3.2.0, v3.1.1 Feb 9, 2014
fat added a commit that referenced this pull request Mar 14, 2014
fix scrollspy for targets within tabs
@fat fat merged commit 8c9739d into twbs:master Mar 14, 2014
@fat
Copy link
Member

fat commented Mar 14, 2014

this is great, thanks so much @moodyroto

@mdo mdo mentioned this pull request Mar 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants