-
Notifications
You must be signed in to change notification settings - Fork 351
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
Fix sidebar section highlighter #1909
Conversation
I couldn't resist, an easy fix. Hopefully improves the feeling. 🙈 |
I wonder if something else is going on as well -- this is what I'm seeing on my end with this PR: sidebar.mp4 |
Hahaha, OK, that's really broken. It's not because of the header offset feeling. |
@rparrett I think now is fixed. The sorting of the visible headings was broken, which caused to highlight the last visible heading, not the first one. This is in Safari: fix-sidebar-safari.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Working well in my browsers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works in firefox and chromium for me on linux. Big win. Thanks!
Apply the header offset to
on-this-page.js
intersection observer. This way the sidebar will highlight the next section as soon as the old section gets below the header. Previously it waited until exiting the viewport.Fixes #1908.
New behavior (header opacity reduced to 0.5 and yellow header just for visualization)
fix-on-this-page-highlight.mp4