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

Fix error in ToC script at the bottom of the page #2002

Merged
merged 2 commits into from
Nov 19, 2024

Conversation

zecakeh
Copy link
Contributor

@zecakeh zecakeh commented Nov 18, 2024

It didn't account for the case where there is no visible heading at the bottom of the page.

The error should be easy to reproduce in the current unstable spec, by navigating to the very bottom of the CS spec. A bunch or errors should appear in the console log.

Pull Request Checklist

Preview: https://pr2002--matrix-spec-previews.netlify.app

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
@zecakeh zecakeh requested a review from a team as a code owner November 18, 2024 13:06
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
@richvdh
Copy link
Member

richvdh commented Nov 19, 2024

Indeed. Error is:

22:04:08.829 Uncaught TypeError: heading is null
    onScroll https://spec.matrix.org/unstable/js/toc.js:155
    throttle https://spec.matrix.org/unstable/js/toc.js:39
    EventListener.handleEvent* https://spec.matrix.org/unstable/js/toc.js:162
    EventListener.handleEvent* https://spec.matrix.org/unstable/js/toc.js:147
toc.js:155:20

This was presumably introduced by #1991.

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@richvdh richvdh merged commit 0657cc1 into matrix-org:main Nov 19, 2024
12 checks passed
@zecakeh zecakeh deleted the toc-fix branch November 19, 2024 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants