Skip to content

On single page site Sidebar does not highlight item navigated to (Docsify v5 Preview) #2509

Closed

Description

@paulhibbitts

Bug Report

Steps to reproduce

View single page with Sidebar
Scroll down page, and tap on Header element
Copy resulting URL with id?
Open new Browser tab, paste copied URL

Current behaviour

The first item in the Sidebar remains highlighted

Expected behaviour

The item in the sidebar should be highlighted matching clicked id? on page (as is shown with Docsify v4, https://paulhibbitts.github.io/docsify-v4-single-page)

Other relevant information

  • Docsify version:

Most recent (v5) Preview

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

  • Docsify plugins (if the bug happens when plugins enabled, please try to isolate the issue):

Please create a reproducible sandbox

Here is a demo using the most recent Preview:

https://paulhibbitts.github.io/docsify-v5-preview-single-page/#

To view bug, go to site, scroll down page and click on a Header element, copy resulting URL, open new Browser tab and paste the URL Might be related to #2504

Edit 307qqv236

Mention the docsify version in which this bug was not present (if any)

Activity

  1. changed the title [-]On single page site Sidebar does not highlight item navigated to (Docsify v5 Preview) #2504[/-] [+]On single page site Sidebar does not highlight item navigated to (Docsify v5 Preview)[/+] on Nov 12, 2024
  2. Koooooo-7 commented on Nov 18, 2024

    @Koooooo-7
    Member

    append:
    Use the uri https://paulhibbitts.github.io/docsify-v4-single-page/#/?id=strikethrough directly to visit page.

    Sometimes, it locates correctly but sometime, it locates on the Bold or My Open Publishing Space and highlight .

    --- update
    Can not reproduce on the dev branch codebase either our site.

  3. added this to the 5.x milestone on Nov 18, 2024
  4. paulhibbitts commented on Nov 18, 2024

    @paulhibbitts
    MemberAuthor

    I've now created a sandbox to help with testing, which uses the latest Preview build: https://codesandbox.io/p/sandbox/long-waterfall-txknd8

  5. Koooooo-7 commented on Nov 19, 2024

    @Koooooo-7
    Member

    I've now created a sandbox to help with testing, which uses the latest Preview build: https://codesandbox.io/p/sandbox/long-waterfall-txknd8

    Strange, I can not reproduce it now, although I revisit the https://paulhibbitts.github.io/docsify-v4-single-page/#/?id=strikethrough ...

  6. sy-records commented on Nov 19, 2024

    @sy-records
    Member

    Reproduced in the sandbox.

    image
  7. Koooooo-7 commented on Nov 19, 2024

    @Koooooo-7
    Member

    -- @sy-records could you reproduce it steady?
    I can not always reproduce it yesterday, sometimes fine, sometimes broken.
    And today, I can not reproduce it totally... either in the sandbox or the site, or copying the sandbox file to locally test.
    Sync what I investigated:
    At the #initHeadings, it finds the activeElement as the first heading, and marked it as active. The page keeps it event it gonna scrolling down to target id place somehow.

    const activeHeading =

  8. sy-records commented on Nov 23, 2024

    @sy-records
    Member

    could you reproduce it steady?

    yep, You can visit https://txknd8.csb.app/#/?id=bold which should have bold actived, but now has My Open Publishing Space actived.

    image
  9. self-assigned this
    on Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugconfirmed as a bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions