Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

xue68
Copy link

@xue68 xue68 commented Nov 3, 2024

save and restore the sidebar position to make the selected entry showed. #490

Copy link

netlify bot commented Nov 3, 2024

Deploy Preview for hugo-hextra ready!

Name Link
🔨 Latest commit 081ad8b
🔍 Latest deploy log https://app.netlify.com/sites/hugo-hextra/deploys/67283652f0924e0008274d9b
😎 Deploy Preview https://deploy-preview-492--hugo-hextra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Owner

@imfing imfing left a 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?

}

sidebarScrollbar.addEventListener('scroll', function() {
saveSidebarPosition();
Copy link
Owner

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.

Copy link
Author

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.

@xue68
Copy link
Author

xue68 commented Nov 4, 2024

To be honest, I don't know how Vitepress is implemented, I'm just referring to the effects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants