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 item highlight jumps back to top (first) Header (Docsify v5 Preview) #2504

Open
1 task done
paulhibbitts opened this issue Oct 19, 2024 · 5 comments
Labels
bug confirmed as a bug

Comments

@paulhibbitts
Copy link
Collaborator

paulhibbitts commented Oct 19, 2024

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

  • 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):

  • Your OS: Mac

  • Node.js version:

  • npm/yarn version:

  • Browser version: Mac Chrome/Firefox/Safari

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 paulhibbitts changed the title One single page site Sidebar item highlight jumps back to top (first) Header One single page site Sidebar item highlight jumps back to top (first) Header (Docsify v5 Preview) Oct 20, 2024
@paulhibbitts paulhibbitts changed the title One single page site Sidebar item highlight jumps back to top (first) Header (Docsify v5 Preview) On single page site Sidebar item highlight jumps back to top (first) Header (Docsify v5 Preview) Nov 12, 2024
@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

@sy-records sy-records added the bug confirmed as a bug label Nov 19, 2024
@sy-records
Copy link
Member

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

@paulhibbitts
Copy link
Collaborator Author

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.

@paulhibbitts
Copy link
Collaborator Author

paulhibbitts commented Nov 24, 2024

Hi @sy-records @Koooooo-7 , I took some more time to review multiple development previews to try to track down around when this issue (and from what I can tell issue #2509 as well) was introduced.

Last working Preview, https://docsify-preview-4vnepages-docsifyjs.vercel.app/preview/#/ fix: skip-to-content scroll behavior (#2401) Apr 16

First not working Preview, https://docsify-preview-aq9deu7pg-docsifyjs.vercel.app/preview/#/ refactor: event modernization and optimization (#2404) Apr 21

Steps to reproduce issue:

  1. View single page with Sidebar
  2. Tap on lower item in Sidebar (i.e. 'Loading dialog'), and scroll to item on page
  3. Scroll page back up

I've made two new sandboxes, one with each of the above previews:
https://codesandbox.io/p/sandbox/white-mountain-z4mc32 (last working Preview, Apr 16)

https://codesandbox.io/p/sandbox/awesome-aryabhata-zwdm6p (first non-working Preview, Apr 21)
bb902f8#diff-ea4acae556aca2d28ddc44a1967680db2196a88d626fb844576071a4636adb6eR82-R83

I hope the above helps with locating the issue and can be confirmed! Please let me know what else I might be able to do to help out etc.

Thanks very much,
Paul

@sy-records
Copy link
Member

Thanks for the test and feedback!

cc @jhildenbiddle

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

2 participants