From 1d6cdb65b32f918fc497953adf02b60e26ea3fec Mon Sep 17 00:00:00 2001 From: mr-july Date: Fri, 23 Dec 2016 07:00:56 +0100 Subject: [PATCH] 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 --- js/src/scrollspy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/scrollspy.js b/js/src/scrollspy.js index 9cb1438ca79a..0a4708bf972a 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, {