Improve tab scroll on click#7531
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
Member
Member
|
I've encountered this problem and this behavior make me very distressed. I wanted to file an issue but I forgot. |
Member
|
To comment on the Starlight part of things:
|
Member
Author
|
I think since upstream support may take a while to iron out, it might be worth to push this along first? The auto-scroll prevention would improve the experience at the meantime. |
TheOtterlord
approved these changes
Apr 1, 2024
Member
TheOtterlord
left a comment
There was a problem hiding this comment.
Yep, I'm happy with adding this for now. Once upstream support is released, we can update this to use the new implementation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description (required)
At https://docs.astro.build/en/install/auto/#1-run-the-setup-wizard, when clicking a package manager tab, it auto scrolls to the tab and I lost focus of where I am 😅 This PR replaces the auto-scroll with a logic that maintains the scroll position when clicking on a tab.
A more complex example where the scroll position can shift is at https://docs.astro.build/en/recipes/sharing-state-islands/#using-atoms. With this PR, the tab I clicked will also maintain its position.
(I think it's best to showcase a video of how it works, but I haven't figured how to do that on my laptop without large file sizes)
Related issues & labels (optional)