From: mr-july Date: Fri, 23 Dec 2016 06:00:56 +0000 (+0100) Subject: scrollspy: fix wrong activation of all nested links (#20304) X-Git-Tag: v4.0.0-alpha.6~229 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d6cdb65b32f918fc497953adf02b60e26ea3fec;p=thirdparty%2Fbootstrap.git scrollspy: fix wrong activation of all nested links (#20304) * fix wrong activation of all nested links; just first level item should be activated * use template instead of string concatenation --- diff --git a/js/src/scrollspy.js b/js/src/scrollspy.js index 9cb1438ca7..0a4708bf97 100644 --- a/js/src/scrollspy.js +++ b/js/src/scrollspy.js @@ -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, {