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

Code annotations do not allow horizontal scroll of code blocks as they disappear on click #3275

Closed
5 tasks done
pawamoy opened this issue Nov 30, 2021 · 4 comments
Closed
5 tasks done
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@pawamoy
Copy link
Sponsor Contributor

pawamoy commented Nov 30, 2021

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

I'm trying code annotations (nice feature, thanks!).
I've added code blocks in some of them.
The popup is not large enough to display the code block entirely (though the longest line has only 72 characters).
Therefore the code block has a scroll bar at the bottom.
But since the popup disappear on click, it is unscrollable.
Well, actually it is, but I have to click again on the annotation, several times if I want to scroll to the far right.

image
image

Expected behaviour

Allow scrolling code blocks in annotations. EDIT: or selecting text, even 🙂

Actual behaviour

Popup disappears when clicking anywhere in it.

Steps to reproduce

  1. Write a code annotation with a relatively large code block in it.
  2. Click on the annotation and try to scroll the code block horizontally.

Package versions

  • Python: 3.8.11
  • MkDocs: 1.2.3
  • Material: 8.0.1

Configuration

site_name: Code Annotations
theme:
  name: material
  features:
  - content.code.annotate

System information

  • Operating system: Windows 10
  • Browser: Firefox 78.15.0esr
@squidfunk
Copy link
Owner

Oops, the disappear-on-click functionality should only trigger when you click on the annotation marker. That's clearly unintended behavior – thanks for reporting!

@squidfunk squidfunk added the bug Issue reports a bug label Nov 30, 2021
@squidfunk
Copy link
Owner

squidfunk commented Nov 30, 2021

Fixed in 194a08e. This was lost in the refactoring – I forgot to pass the reference element to getElements.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Nov 30, 2021
@squidfunk
Copy link
Owner

... and released as part of 8.0.2. I decided to get this out fast as it severely limits interaction with code annotations.

@pawamoy
Copy link
Sponsor Contributor Author

pawamoy commented Nov 30, 2021

Thanks for the extremely quick fix!

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