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

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

Open
1 task
paulhibbitts opened this issue Nov 12, 2024 · 6 comments
Labels
bug confirmed as a bug
Milestone

Comments

@paulhibbitts
Copy link
Collaborator

paulhibbitts commented Nov 12, 2024

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)

@paulhibbitts paulhibbitts 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) Nov 12, 2024
@Koooooo-7
Copy link
Member

Koooooo-7 commented Nov 18, 2024

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.

@paulhibbitts
Copy link
Collaborator Author

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

@Koooooo-7
Copy link
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 ...

@sy-records
Copy link
Member

Reproduced in the sandbox.

image

@Koooooo-7
Copy link
Member

Koooooo-7 commented Nov 19, 2024

-- @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 =

@sy-records
Copy link
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug confirmed as a bug
Projects
None yet
Development

No branches or pull requests

3 participants