-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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: Page reload on repeated page link click (Firefox) #6102
Comments
@alexvoss thanks for verifying the reproduction. Could you try incognito mode in Chrome? There might be some browser extension that interferes. In incognito mode all browser extensions are turned off. If it still happens, we need to look into that as well. |
Using incognito (in Firefox), I get the same behaviour. I would have said the event handler does not get re-bound when replacing the page fetched using XHR but it does work when loading other pages, just not when hitting the link for the page already loaded. |
Okay, so I invested an hour without success. There are still several problems with instant navigation that we can't easily address without adding further bandaids. Getting all cases right in all browsers is quite a challenge due to the many possible interactions there are. I already added a hack that omits a new flickering that happens rarely in 4743c1b since we generalized the meta tag replacement logic. I'm going to need some more time to tackle the problem reported and will take the opportunity to do another refactoring of instant navigation. The focus will be stable meta tag replacement and stable anchor and link detection/deduplication. If somebody wants to take a shot at this, happy to collaborate on a PR. Instant navigation is extensively documented. |
Clicks are intercepted at the mkdocs-material/src/templates/assets/javascripts/integrations/instant/index.ts Lines 156 to 163 in bc9cdb5
|
I wasn't sure where else to report this, but I have a rather large mkdocs projects (unfortunately can't share it) where starting with What it looks like when Disabling I've been trying to reproduce this issue on a smaller, minimal example with no luck yet. I will continue to see if I can create a minimally reproducible example. I wanted to at least report it here. Environment
features:
- content.code.annotate
- content.code.copy
- content.tabs.link
- navigation.expand
- navigation.footer
- navigation.instant
- navigation.top
- navigation.tracking
- search.highlight
- search.share
- search.suggest
- toc.follow Bisection
Perhaps one of: |
Thanks for noting, @johnthagen. We definitely need to observe the error on a minimal reproduction to fix it. |
@squidfunk I was able to bisect down my particular issue to |
I'm having the same issue with Microsoft Edge. |
navigation.instant
enabled (Firefox)
Fixed in https://github.com/squidfunk/mkdocs-material-insiders/pull/79 – the fixes are currently only in Insiders, so anybody having access can already test them. I still need to do some minor refactoring that shouldn't impact the functionality, and after that, I'll backport the fixes to the community edition. I just wanted to give them into the hands of users as soon as possible. This should resolve all known problems with instant loading, at least I've tested this and all other issues. |
Fixes are now in #6662. Please check if the errors are now fixed when using this version in your project:
|
Released as part of 9.5.5. |
Context
No response
Bug description
When
navigation.instant
is enabledclicking repeatedly on the same page link reloads the page from scratch without XHR. Clicking on other page links works as expected.
This problem occurs in Firefox but not in Chrome. That said, both Firefox and Chrome enable the "Go forward one page" button next to the address bar when clicking on the same page link repeatedly. It seems that an incorrect entry gets added to the history.
Related links
Reproduction
9.4.2-xhr-reload.zip
Steps to reproduce
Browser
Firefox
Before submitting
The text was updated successfully, but these errors were encountered: