-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
Context
We have a "reported issues" tracking page on our documentation that utilizes H3 elements within collapsed admonitions to help provide navigation on page with the TOC and create a more condensed page (reading wise).
Recently we reintroduced navigation.instant
to our docs as part of mkdocs-material 9.1.1 to solve the following issues outlined in this PR:
Ideally what usually happens is when a user clicks on a link in the TOC it would take them to the relevant section on the page and open the admontion.
removed live site example as we removed instant navigation on production
example.zip with minimal repro provided below
Bug description
Issue
With navigation.instant
enabled on our build we recently discovered that clicking on links in the table of contents in certain browsers outlined below would not jump to the relevant anchor/section when the header is positioned within a collapsible admonition.
It is currently not working on:
- Safari (all devices)
- Firefox (Windows + iPadOS tested)
Example:
??? bug "Title of Admonition"
### header
text
Additional Context
This setup has worked for us on all browsers and devices until we discovered this issue recently with no changes to our build. Currently, it only works on the Chrome Browser (Windows + MacOS + Mobile Devices).
It is important to note that anchor links / section links work flawlessly on any browser when the header is not placed within an admonition.
Related links
Relevant Discussions I looked at:
- Safari subtitle link not working #5073
- Instant loading does not work with section anchors in Safari #3797
Reproduction
Example provided below
Please see the page titled Example Issue:
it is a clone of our reported issues page on our live site.
Steps to reproduce
- Ensure
navigation.instant
is active in the config. - Ensure that admonitions is configured in the config.
- Create a collapsible admonition with a header element nested within (example in bug section or below here) on a page of your choice
- Spin up
mkdocs serve
or build - Navigate to
localhost:8000
or open index.html on Safari or Firefox - Using Safari or Firefox // on the page try and navigate to a header nested within an admonition (samples available in repro zip file)
Expected outcome: You would be taken to the link you clicked on in the TOC + admonition would open to reveal content.
Current outcome: Navigation does not happen and TOC links are inoperable.
Example admonition setup:
??? bug "Title of Admonition"
### header
text
Browser
Safari, Firefox
Before submitting
- I have read and followed the bug reporting guidelines.
- I have attached links to the documentation, and possibly related issues and discussions.
- I assure that I have removed all customizations before submitting this bug report.
- I have attached a .zip file with a minimal reproduction.