New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instant loading not allowing to go back to initial page #5023
Comments
So first of all, thanks for reporting and the excellent reproduction and for checking in which version the regression was introduced – you definitely invested time into this, which is invaluable for us maintainers. This is also why we award this bug report the 🏆 perfect badge, the first time ever! Now to the bug: I checked 8.5.11 vs 9.0.0b1 and yes, I can observe the same behavior. However, there were absolutely no changes on instant loading between those versions, which is why I believe that this is a bug that now somehow manifests because new behavior was added somewhere else. There were a lot of changes in version 9, so it's not surprising. Instant loading is in need of refactoring, which we will tackle later this year. I think I have a fix in 329d26d. If that's true, then it's clearly of the category "how did that ever work", because when you first visit the page, the state is obviously |
The last commit introduced another small bug: when you click an anchor on the same page, the page jumps back to the top. This is now fixed in f480bb2. As said, we need to refactor instant loading. |
Okay, never mind... there are still problems with the fixes applied. I think this may take longer since all browsers seem to behave differently 😅 I'll try to fix this on the weekend. |
I've reverted both commits. I'll tackle this together with #3797. |
#5032 contains a refactoring of instant loading. I'm not sure that it's finished yet, but if you find some time for testing, that would be amazing. You can install it with:
|
The reported issue seems fixed. Thanks! However, there is an interesting corner case I just noticed. If you navigate to a page and press refresh button and then press back, it does not work correctly (URL gets updated, but contents stay the same). Is this also fixable? |
I'll look into it. |
The issues should be fixed in #5023. I've taken the time and did a complete rewrite of instant loading. It should be much more stable now. I'll issue a new release shortly, so we can find any remaining bugs quickly, but I'm quite confident that scroll restoration should work much better now. I've tested in Chrome, Firefox and Safari. |
Released as part of 9.1.1. |
It works great. Thank you, @squidfunk! |
Context
No response
Bug description
Going back to a page via browser back button with Instant loading enabled in general works fine. However, going back via browser back button to the the first page that was loaded doesn't work. To illustrate the idea:
https://gaseri.org/en/
in the location bar (first page)https://gaseri.org/en/introductory-presentation/
via the link in the navigation bar (second page)https://gaseri.org/en/people/principal-investigator/
via the link in the navigation bar (third page)https://gaseri.org/en/introductory-presentation/
and its contents load fine as expectedhttps://gaseri.org/en/
in the location bar, but the contents ofhttps://gaseri.org/en/introductory-presentation/
are still shownThis is just to illustrate what is working and what is not; my minimal example attached below has only two pages that reproduce the issue.
I tested latest versions of Firefox and Brave, same issue. Finally, this is a regression from introduced in 9.0.0b1 and later versions of Material for MkDocs; version 8.5.11 works fine.
Related links
Reproduction
example.zip
Steps to reproduce
mkdocs serve
http://127.0.0.1:8000/
in browserPage 1
Page 1
Browser
No response
Before submitting
The text was updated successfully, but these errors were encountered: