Restore scroll position when going back in the docs - #597
Conversation
|
Yeah, I've at least once been annoyed by this behavior too. I'm seeing now that Mintlify's docs site does jump back to the section you were in, and by you pointing out the Almond theme specifically, I'm assuming a different theme might come with this feature built-in? If a different theme doesn't come with other quirks and solves this I think we'd rather switch to it than add a workaround like this. |
|
Hi @benitav, I have been testing the Here is the repro of the bug with the theme set to
Expected: return to the previous page, at that heading. The most likely cause is when you click a heading, mintlify is calling mintlify-bug.mp4 |
|
Thanks for that - bummer. I reached out to Mintlify to hear if they could fix it at the theme level. Ideally we don't have to deploy this kind of workaround. Will keep you posted. |
Summary
When you scroll down a docs page, click an in-site link, then hit Back, the page jumps to the top instead of where you left off.
Mintlify (almond theme) does not scroll the window. It scrolls an inner container (
#content-container). The browser only restores window scroll, so it cannot put you back where you were.This adds a small script that:
Mintlify loads
.jsfiles in the repo root on every page, so nodocs.jsonchange is needed.Test plan