This repository was archived by the owner on Aug 7, 2021. It is now read-only.
This repository was archived by the owner on Aug 7, 2021. It is now read-only.
Don't highlight the first item until the user has reached it #91
Open
Description
I have the following sections on my page:
intro
skillset
values
showcase
my-story
My navbar has a link for all of these items, except for intro
, which I'm not using in this case:
<Scrollspy
className="navbar-nav ml-auto"
currentClassName="active"
items={['skillset', 'values', 'showcase', 'my-story']}
offset={-100}
>
Links ...
</Scrollspy>
If the user is inside the intro
section, but behind the skillset
section, it'll apply the currentClassName
to skillset
(the first item in items
). This shouldn't happen until the user is there.
Adding intro
to the ScrollSpy
(a link and item to its items
prop) fixes this. So as a workaround I've done this but used display: none
on it so it doesn't show.
Metadata
Metadata
Assignees
Labels
No labels