Is it possible to preserve the scrollbar in a nav menu between page changes, without setting up a layout plugin?
I'm building a documentation site that has two primary layouts interchanged depending on what "kind" of docs you're looking at (regular vs api). Both of these menus can be long, and changing pages always jumps the sidebar up to the top, which is a bad experience for the user.
I don't want to use a layout plugin because not every page is going to have the same layout, and adding extra complexity to decide which layout to show just to preserve a scrollbar is tedious, difficult to follow and more prone to error. Ideally I'd like to find a solution to preserve the scrollbar in the side menu without wrapping it in a layout plugin.
Thanks!
Pages are always unmounted when they change. You can use wrapPageElement API to provide a component that renders your sidebar.
Hiya!
This issue has gone quiet. Spooky quiet. 馃懟
We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contributefor more information about opening PRs, triaging issues, and contributing!
Thanks for being a part of the Gatsby community! 馃挭馃挏
@mattoni Have you looked into using Mikhail's suggestion of trying wrapPageElement?
@lannonbr I think that's what I'm going to have to do to make it work unfortunately. Thanks for the assistance.