Skip to content
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: internal anchor links don't work in Safari #6334

Closed
4 tasks done
thesuperzapper opened this issue Nov 14, 2023 · 9 comments
Closed
4 tasks done

Instant loading: internal anchor links don't work in Safari #6334

thesuperzapper opened this issue Nov 14, 2023 · 9 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@thesuperzapper
Copy link

Context

No response

Bug description

In MkDocs Material 9.4.8, it seems that internal heading anchor links don't work properly on Safari when using navigation.instant.

Note, this reliably happens, but sometimes you might need to clear your cache first.

Related links

Reproduction

9.4.8-safari-anchor-links.zip

Steps to reproduce

  1. Use my reproduction.
  2. Open the website in safari.
  3. Click the link on the homepage.
  4. Notice that you are at the top of the page, not scrolled to "Section 2"

(Also, I am not sure if it's related, but the table of contents sidebar will be partially cut off until you scroll the page)

Screenshot 2023-11-14 at 11 54 13

Browser

Safari

Before submitting

@squidfunk squidfunk added the needs investigation Issue must be investigated by the maintainers label Nov 14, 2023
@squidfunk
Copy link
Owner

Thanks for reporting. Could I ask you to try to bisect the version that introduced the problem? As you noted, we fixed it in #3797, so you would do us a great favor in helping isolate the bad commit ☺️

@thesuperzapper
Copy link
Author

Well, I was also seeing this on 9.2.3, so I am not sure if that helps.

@thesuperzapper
Copy link
Author

Another interesting issue which might be related (occurs on all browsers):

  1. Click a internal link
  2. Click the browser's back button
  3. Click the same link again (fails to do anything)

@PaulSonOfLars
Copy link

Can confirm that when using navigation.instant and navigation.footer, the footer links will stop working after pressing the browser's "back" button

@squidfunk
Copy link
Owner

squidfunk commented Nov 15, 2023

Thanks. Safari has been pesky to work with in the past. We'll investigate and fix this issue once we find some time to do a refactor of instant loading. In the meantime, you can disable navigation.instant to mitigate the problem.

@squidfunk squidfunk added bug Issue reports a bug and removed needs investigation Issue must be investigated by the maintainers labels Nov 15, 2023
@thesuperzapper
Copy link
Author

@PaulSonOfLars @squidfunk I have raised a separate issue for the more serious problem I raised in #6334 (comment).

New issue: #6345

@squidfunk squidfunk changed the title internal anchor links dont work in safari with instant loading Instant loading: internal anchor links don't work in Safari Nov 17, 2023
@squidfunk
Copy link
Owner

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.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Jan 18, 2024
@squidfunk
Copy link
Owner

Fixes are now in #6662. Please check if the errors are now fixed when using this version in your project:

pip install git+https://github.com/squidfunk/mkdocs-material.git@fix/instant-loading-bugs

@squidfunk
Copy link
Owner

Released as part of 9.5.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

3 participants