Skip to content

fix(sidebar): scroll to the active item after navigating #4211

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

Merged
merged 1 commit into from
Jul 23, 2025

Conversation

brandyscarney
Copy link
Member

@brandyscarney brandyscarney commented Jul 22, 2025

Problem:
When navigating the docs site, the sidebar does not update to reflect the active item.

Solution:
This PR updates the sidebar to scroll the active item into view when a new page is selected.

Test steps:

  1. Visit https://ionicframework.com/docs/components
  2. Scroll down and select "Popover"
  3. Notice that the sidebar remains at the top (starting at "Accordion") and "Popover" is not visible
  4. Visit https://ionic-docs-git-fix-sidebar-scroll-ionic1.vercel.app/docs/components
  5. Repeat step 2
  6. Confirm that the sidebar now scrolls to and highlights "Popover"

Repeat the test steps above for a "Guide" page:

  1. Go to https://ionicframework.com/docs/
  2. Click on the "Theming" card
  3. Notice the sidebar remains at the top
  4. Repeat for https://ionic-docs-git-fix-sidebar-scroll-ionic1.vercel.app/docs/

Copy link

vercel bot commented Jul 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ionic-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 22, 2025 6:51pm

@brandyscarney brandyscarney marked this pull request as ready for review July 22, 2025 18:53
@brandyscarney brandyscarney requested a review from a team as a code owner July 22, 2025 18:53
@brandyscarney brandyscarney requested review from gnbm and ShaneK July 22, 2025 18:53
Copy link
Member

@ShaneK ShaneK left a comment

Choose a reason for hiding this comment

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

Nice!

@brandyscarney brandyscarney merged commit 0e164eb into main Jul 23, 2025
4 checks passed
@brandyscarney brandyscarney deleted the fix-sidebar-scroll branch July 23, 2025 21:19
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