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

feat: Improve Sidebar and Aside Link Visibility on Mount and Route Change #3901

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

Conversation

brenoepics
Copy link

This PR introduces enhancements to the sidebar and aside navigation in the default theme. It ensures that the active sidebar link is always visible to the user, both when the page loads and when the route changes.

fixes #3351 is this one a duplicate of #3000 ?
fixes #3426
p.s: I opened this pr because I can't change the #3654 one and it needs rebase

brenoepics and others added 5 commits May 18, 2024 00:05
Optimize the `aside-container` to update scroll behavior when the `activeLink` is out of the viewport.
Automatically scrolls to ensure the active sidebar link is in view upon page load.

Co-Authored-By: Bobbie Goede <[email protected]>
Ensures the sidebar link visibility is maintained not only on page load, but also when the route changes.
@github-actions github-actions bot added the stale label Jun 23, 2024
} else {
marker.value.style.top = '33px'
marker.value.style.opacity = '0'
aside.value.scrollTop = 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, may I ask what this line of code is doing? I saw in the developer tools that the aside itself does not generate a scroll bar, so scrollTop remains 0 all the time. Can this piece of code and related parts be removed?

@github-actions github-actions bot removed the stale label Jul 17, 2024
@github-actions github-actions bot added the stale label Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: cannot automatically top the current page Keep aside marker visible
2 participants