docsifyjs / docsify

πŸƒ A magical documentation site generator.
https://docsify.js.org
MIT License
27.82k stars 5.68k forks source link

On single page site Sidebar item highlight jumps back to top (first) Header (Docsify v5 Preview) #2504

Open paulhibbitts opened 1 month ago

paulhibbitts commented 1 month ago

Bug Report

Steps to reproduce

  1. View single page with Sidebar
  2. Tap on lower item, and view item on page
  3. Scroll page back up

The highlighted item in the Sidebar jumps back to the first Header (item). Also, if the app name (i.e. Simple Docsify Templates) is clicked that jumps to the first Header item when the page reloads.

Current behaviour

The highlighted item in the Sidebar jumps back to the first Header (item)

Expected behaviour

As the page is scrolled up (or down), each item should highlight one by one as the page is scrolled back to the top (as is shown with Docsify v4, https://paulhibbitts.github.io/docsify-v4-single-page)

Other relevant information

Most recent (v5) Preview

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, tap "Code" on Sidebar, and then scroll page back up. Might be related to #2509

Edit 307qqv236

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

paulhibbitts commented 4 days ago

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

sy-records commented 3 days ago

Replicated in https://paulhibbitts.github.io/docsify-v5-preview-single-page. The behavior of the sidebar selections is a bit confusing.

paulhibbitts commented 3 days ago

Thanks very much for taking a look @sy-records , please let me know if I can be of more help re: more info/testing etc.