readthedocs / sphinx_rtd_theme

Sphinx theme from Read the Docs
https://sphinx-rtd-theme.readthedocs.io/
MIT License
4.81k stars 1.74k forks source link

Sticky navbar jolts to nav anchor on click #1586

Open dylanh724 opened 3 months ago

dylanh724 commented 3 months ago

Details

Expected Result

The left [sticky] navbar shouldn't move at all when a toctree navbar element is clicked for a smooth nav UX.

(OR, at with an option to turn this off, anchor jump top the top-level parent category; not to individual children)

Actual Result

Navigating to new pages "jolts" the navbar, scrolling down to align with whatever child navbar toctree element was clicked. This creates a frustrating UX experience. See this low-quality GIF (apologies, the mp4 was too big in size):

GIF

Thoughts

What I believe is happening is that click jumps to the body's selected header -- intended and good. However, if it's a sticky navbar, the navbar is separately jumping to its own anchor (not intended -- or if intended, it should be optional and default off since it looks glitchy)

TL;DR Only the body should be anchored on click; not the navbar itself in addition.

humitos commented 3 months ago

Hi, thanks for reporting this issue. I'm moving it to the Sphinx theme since it's related to it.