🐛 Prevent scroll-to-top on restart/fast buttons in the documentation#1904
Merged
Conversation
Contributor
📝 Docs previewLast commit 3222610 at: https://7c266ce6.typertiangolo.pages.dev Modified Pages |
svlandeg
approved these changes
Jul 22, 2026
svlandeg
left a comment
Member
There was a problem hiding this comment.
I haven't reviewed/checked this in detail, but I know that @YuriiMotov did for fastapi/fastapi#13714 so this is more than likely just fine.
I can confirm that I've encountered this bug earlier in the Typer docs myself. The "being forced to the top" actually didn't always happen for me, but sometimes.
Either way, on the documentation pages produced with this PR, I can't replicate the bug anymore 🎉
Thanks @phalberg !
svlandeg
marked this pull request as ready for review
July 22, 2026 10:23
This was referenced Jul 22, 2026
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.
Pull Request
Discussion: #1887
Description
Motivation
Upon clicking
fastorrestartin terminal widgets within the documentation, one would be forced to the top-of-the-page, which disrupts the user and makes it slightly harder to read documentation (perhaps).Solution
This was a previously resolved issue in the FastAPI docs and the fix was proposed in this PR: fastapi/fastapi#13714 - which eventually got merged.
I used the same fix that was merged there, changing
href = #to rather behref = javascript:void(0), which should keep consistency across the repos.(I suggest looking at the original FastAPI PR for more technical depth on the solution, which I linked above)
AI Disclaimer
No AI was used in the process of this PR.
Checklist