How does the navigation work when using instant loading? #2099
-
Just saw that you've added an instant loading feature to make Material for MkDocs behave more like a single page app. So cool. I'm excited to give this a whirl, but quick question first: when I click a link in a doc's content, or an item in the left nav, does the left nav stay persistent (scroll position, nodes that are open, etc.)? Or does the left nav reload to its default state for the new destination? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Instant loading replaces designated parts of the site without reloading the whole page. The logic is rather "dumb", so it will just replace the sidebar HTML with the new HTML and rebind all downstream event listeners (implemented through RxJS observables), thus the scroll position is lost if the sidebar was scrolled before. In theory, this could be mitigated with some extra JavaScript, but I haven't found the need to do so, yet. |
Beta Was this translation helpful? Give feedback.
-
I ran into the same issue (I think) |
Beta Was this translation helpful? Give feedback.
Instant loading replaces designated parts of the site without reloading the whole page. The logic is rather "dumb", so it will just replace the sidebar HTML with the new HTML and rebind all downstream event listeners (implemented through RxJS observables), thus the scroll position is lost if the sidebar was scrolled before.
In theory, this could be mitigated with some extra JavaScript, but I haven't found the need to do so, yet.