Skip to content

Commit

Permalink
scrollspy: fix wrong activation of all nested links (#20304)
Browse files Browse the repository at this point in the history
* fix wrong activation of all nested links;
just first level item should be activated

* use template instead of string concatenation
  • Loading branch information
mr-july authored and mdo committed Dec 23, 2016
1 parent 6993595 commit 1d6cdb6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/src/scrollspy.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ const ScrollSpy = (($) => {
} else {
// todo (fat) this is kinda sus...
// recursively add actives to tested nav-links
$link.parents(Selector.LI).find(Selector.NAV_LINKS).addClass(ClassName.ACTIVE)
$link.parents(Selector.LI).find(`> ${Selector.NAV_LINKS}`).addClass(ClassName.ACTIVE)
}

$(this._scrollElement).trigger(Event.ACTIVATE, {
Expand Down

0 comments on commit 1d6cdb6

Please sign in to comment.