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

Tooltip doesn't appear on links with ellipsis when inside collapsed nav sections #4026

Closed
5 tasks done
wilhelmer opened this issue Jun 15, 2022 · 3 comments
Closed
5 tasks done
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@wilhelmer
Copy link
Contributor

Contribution guidelines

I've found a bug and checked that ...

  • ... the problem doesn't occur with the mkdocs or readthedocs themes
  • ... the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

Bildschirmaufnahme.2022-06-15.um.10.49.12.mov

Expected behaviour

When enabling content.tooltips, tooltips should appear on all links that are shortened with ellipsis.

Actual behaviour

Navigation items that are shortened with ellipsis inside collapsed sections don't have tooltips.

After reloading the page with the section expanded, the tooltip appears. See video.

Steps to reproduce

See video.

Package versions

  • Python: 3.9.13
  • MkDocs: 1.3.0
  • Material: 8.3.4+insiders.4.18.0

Configuration

site_name: Test Project
theme:
    name: material
    features:
        - content.tooltips
use_directory_urls: false
plugins:
  - offline
nav:
  - Welcome: index.md
  - Section:
      - Subsection:
        - VeryVeryVeryVeryVeryVeryLongTopicTile: second.md

System information

  • Operating system: macOS Monterey
  • Browser: Firefox
@squidfunk squidfunk added the bug Issue reports a bug label Jun 15, 2022
@squidfunk
Copy link
Owner

Fixed in 57ea24b. The reason for this behavior was that all elements with the md-ellipsis class were only filtered once the document was loaded (and on every instant loading event), and then filtered for whether they show an ellipsis or not, i.e. overflow. Initially invisible elements were always filtered, which means that tooltips were never mounted, even though they became visible later. Now, every element is watched for visibility, and once it becomes visible, the tooltip is mounted. If it becomes invisible again, the tooltip is retained. I first checked if we could just add and remove tooltips when elements change visibility, but that led to an increase in pressure on the rendering engine, especially when you scroll fast.

For this reason, keeping elements once they become visible once is the best compromise. With navigation tabs and sections enabled, there may be many elements that will never become visible on larger screens, i.e. for the inactive tabs, which need to be included for mobile navigation.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Jun 16, 2022
@squidfunk
Copy link
Owner

Released as part of 8.3.6+insiders-4.18.2.

@wilhelmer
Copy link
Contributor Author

Confirming that this is fixed in 4.18.2. Thanks so much!

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

2 participants