I seem to be having an issue with bootstrap scrollspy.
For example:
<header class="header pb-4 pb-lg-0 pt-4 sticky-top bg-white">
...
</header>
<div class="container-fluid width content-main" data-bs-spy="scroll" data-bs-target="#menuMainnav" data-bs-smooth-scroll="true" tabindex="0">
...
</div>
When I navigate forward in the navigation (from 1 to 2 to 3 to 4), everything seems to work fine with the active state being displayed correctly. However, when I navigate backwards (from 4 to 3 to 2 to 1), I encounter an issue. The active state in the navigation jumps from 3 to 2 and then from 2 to 1.
I have experimented with offset and rootMargin but so far nothing seems to resolve the issue.
Does anyone have any insights on what might be causing this problem?