Skip to content

Auto scroll doesn't work for h6 headings. #2628

@shannon

Description

@shannon

Description

I discovered this because some of the links that show up in the search plugin do not auto scroll to the correct location.

It seems that for quite some time, the onNavigate query selector only goes down to h5.

Surely this line should be :where(h1, h2, h3, h4, h5, h6) no?

Expected behavior

When clicking on a link that includes an anchor that is an h6 header ###### Header, the page should navigate to the correct page and then auto scroll to the correct header.

Actual behavior

The page navigates to the correct page but it does not scroll at all. It doesn't scroll to the anchor or to the top of the page like it should. It ends up in a location based on the scrollTop position of the page navigated way from, which can be quite disorienting.

Steps to reproduce

  1. Create a document test.md with a large amount of content to make sure that there is enough to create scrolling
  2. At the bottom of the document add ###### Test
  3. In _sidebar.md add - [Test](test.md#test)
  4. Load the page and click the Test in the sidebar
  5. Observe that test.md is loaded but does not auto scroll to the Test section.

Environment

  • Docsify Version: 5.0.0-rc
  • Browser Version: all

Additional Information

  • Bug still occurs when all/other plugins are disabled?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Triagebugconfirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions