Skip to content

Large table of contents gets cut off #1220

@nmoinvaz

Description

@nmoinvaz

🐛 Bug Report

When you have a large table of contents with many items, some of them get cut off at the bottom of the page. A user visiting the site might not know there are additional items in the table of contents.

Have you read the Contributing Guidelines on issues?

Sort of.

To Reproduce

  1. Create a markdown page that has lots of h1/h2 tags with different names.
  2. View the table of contents on the right hand side
  3. Scroll down in Chrome and view that some of them are cut off.

Expected behavior

It should automatically show a scrollbar in the table of contents if there are too many items.

Actual Behavior

The table of content items gets cut off. You are able to scroll it, if you place your mouse over the table of contents and use the mouse scroll wheel to scroll down. However, that is not transparent to the user that they can do that or that there are more items in the table of contents.

Reproducible Demo

image

I have attached doc2.md in doc2.zip. On the right of the table of contents you can see Test 4 items are missing.

Possible Fix

I think max-height and overflow-y should added to toc-headings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its executiongood first issueIf you are just getting started with Docusaurus, this issue should be a good place to begin.help wantedAsking for outside help and/or contributions to this particular issue or PR.status: claimedIssue has been claimed by a contributor who plans to work on it.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions