From: Troy Morehouse Date: Sun, 17 Sep 2017 07:30:37 +0000 (-0300) Subject: fix(scrollspy): Spying on nested navs fails to activate for .nav-link's inside nav... X-Git-Tag: v4.0.0-beta.2~235 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c70c70f637267ca109f44ff63f564892ece42bf;p=thirdparty%2Fbootstrap.git fix(scrollspy): Spying on nested navs fails to activate for .nav-link's inside nav-item's (#23967) * fix(scrollspy): Handle nested navs when nav-link inside nav-item * [scrolspy] Find only child .nav-link's inside .nav-item * [scrollspyt] Add tests for nested navs with nav-link inside nav-item * fix troy-o's in test --- diff --git a/js/src/scrollspy.js b/js/src/scrollspy.js index 70067c0b35..e8f0d3101b 100644 --- a/js/src/scrollspy.js +++ b/js/src/scrollspy.js @@ -54,6 +54,7 @@ const ScrollSpy = (() => { ACTIVE : '.active', NAV_LIST_GROUP : '.nav, .list-group', NAV_LINKS : '.nav-link', + NAV_ITEMS : '.nav-item', LIST_ITEMS : '.list-group-item', DROPDOWN : '.dropdown', DROPDOWN_ITEMS : '.dropdown-item', @@ -264,6 +265,8 @@ const ScrollSpy = (() => { // Set triggered links parents as active // With both