-
-
Notifications
You must be signed in to change notification settings - Fork 199
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: restore the sidebar position to make the selected entry showed #492
Conversation
✅ Deploy Preview for hugo-hextra ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
btw, can you share the vitepress implementation you mentioned for saving the sidebar scroll position?
assets/js/sidebar.js
Outdated
} | ||
|
||
sidebarScrollbar.addEventListener('scroll', function() { | ||
saveSidebarPosition(); |
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.
I think you need debouncing the event handler.
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.
ok, I have add the new function.
To be honest, I don't know how Vitepress is implemented, I'm just referring to the effects. |
update the theme 241104
There’s an issue after this change: switching between sidebar items would cause a noticeable jittering effect every time. Screenshot.2024-11-07.at.12.48.02.mp4Previous: Screenshot.2024-11-07.at.12.49.04.mp4 |
I've noticed this issue, but I've been struggling to figure out how to fix it. After testing, it is now possible to significantly reduce the frequency of occurrences. |
save and restore the sidebar position to make the selected entry showed. #490