I have a bootstrap4 menu set up like this:
<ul class="navbar-nav ml-auto">
<li class="nav-item"><a class="nav-link" href="#introduction">INTRODUCTION <span class="sr-only">(current)</span></a></li>
</ul>
The default scroll spy automatically adds the 'active' class to the nav-link (a) element, but I need it to be added to the nav-item (li) instead. Is there a way to achieve this?
You can see an example of the issue here: Example
When I click on the link, everything works fine, but on scroll, the 'active' class is added to the link instead of the list item.