-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clicking on nav link doesn't apply active style #25
Comments
@charliefisher Hi there, there is a component prop If you have trouble seeing the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi this is super helpful, but I've hit an issue with applying active styles. I tried to set up a repl.it to reproduce this issue, but this package isn't supported on Linux.
I have an
<a>
tag with a link to anid
. When I click it, it appears to properly scroll to the link, but doesn't apply the active style.I am on Windows 64 bit, Chrome version 80.0.3987.149.
After a little debugging, I figured out this was happening because
window.scrollTo
is not actually scrolling to the exact coordinates given as parameters (I'm not sure why that happens though). The element has apageYOffset
of 727. I'm not sure what the most appropriate fix is for this, I was able to resolve this issue locally by doing:An alternative solution would be to change the condition at line 48 of
ScrollSpyNav.js
to check for proximity within some epsilon of the element's location.Let me know what you think and then I can go ahead and PR a fix.
The text was updated successfully, but these errors were encountered: