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

Jumping to anchor inside details doesn't open it #540

Closed
max-ci opened this Issue Oct 26, 2017 · 6 comments

Comments

Projects
None yet
2 participants
@max-ci

max-ci commented Oct 26, 2017

Description

If you click on the footnote arrow at the bottom of the page and footnote is inside details it doesn't jump to the note (when details is closed).

Expected behavior

Appropiate details should be opened when you click on the footnote arrow and it should jump to the note.

Actual behavior

Clicking on the arrow doesn't work when footnote is inside details and details is closed.

Steps to reproduce the bug

  1. Create footnote in details.
  2. Click on the footnote arrow at the bottom of the page (details must be closed).

Package versions

  • MkDocs: 1.12.1
  • Material: 0.16.3

Project configuration

Irrelevant

System information

Irrelevant

Possible fix:

  1. Detect if footnote is inside details
  2. If yes - preventDefault(), if no - normal behaviour
  3. Check if details is opened, if yes - change hash in the url, if no - open it and change hash in the url
@squidfunk

This comment has been minimized.

Show comment
Hide comment
@squidfunk

squidfunk Oct 27, 2017

Owner

Thanks for your report. The same should hold for headlines with permalinks. It's, however, a very low priority issue.

Owner

squidfunk commented Oct 27, 2017

Thanks for your report. The same should hold for headlines with permalinks. It's, however, a very low priority issue.

@squidfunk squidfunk changed the title from Footnote in details to Jumping to anchor inside details doesn't open it Oct 27, 2017

@squidfunk

This comment has been minimized.

Show comment
Hide comment
@squidfunk

squidfunk Nov 5, 2017

Owner

Fixed in #570

Owner

squidfunk commented Nov 5, 2017

Fixed in #570

@squidfunk squidfunk self-assigned this Nov 5, 2017

@squidfunk

This comment has been minimized.

Show comment
Hide comment
@squidfunk

squidfunk Nov 5, 2017

Owner

Fix released with 2.0.3

Owner

squidfunk commented Nov 5, 2017

Fix released with 2.0.3

@squidfunk squidfunk closed this Nov 5, 2017

@max-ci

This comment has been minimized.

Show comment
Hide comment
@max-ci

max-ci Nov 5, 2017

There is an error when you click on the arrow. This is because of the colon in the selector, for example #fnref:1. Need to escape this colon when using querySelector.

max-ci commented Nov 5, 2017

There is an error when you click on the arrow. This is because of the colon in the selector, for example #fnref:1. Need to escape this colon when using querySelector.

@squidfunk

This comment has been minimized.

Show comment
Hide comment
@squidfunk

squidfunk Nov 5, 2017

Owner

Ah thanks, haven't tested it with footnotes, only with headlines. My fault. will provide a fix.

Owner

squidfunk commented Nov 5, 2017

Ah thanks, haven't tested it with footnotes, only with headlines. My fault. will provide a fix.

@squidfunk squidfunk reopened this Nov 5, 2017

@squidfunk

This comment has been minimized.

Show comment
Hide comment
@squidfunk

squidfunk Nov 5, 2017

Owner

Just released 2.0.4 which fixes the error with querySelector by using getElementById which should be more robust for these errors.

Owner

squidfunk commented Nov 5, 2017

Just released 2.0.4 which fixes the error with querySelector by using getElementById which should be more robust for these errors.

@squidfunk squidfunk closed this Nov 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment