Skip to content

click left sidebar, then refresh the page, lost the sync scroll. #1136

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

Closed
1 task
vagra opened this issue Apr 24, 2020 · 2 comments · Fixed by #1146
Closed
1 task

click left sidebar, then refresh the page, lost the sync scroll. #1136

vagra opened this issue Apr 24, 2020 · 2 comments · Fixed by #1146
Labels
bug confirmed as a bug

Comments

@vagra
Copy link
Contributor

vagra commented Apr 24, 2020

Bug Report

Steps to reproduce

  1. open a page like https://docsify.js.org/#/configuration

  2. click a sub-sidebar link (the toc of current document), or click a heading in the main content

  3. using F5, refresh the current page

What is current behaviour

the page lost sync scroll.
when you scroll the main page, the sidebar could not sync scroll.

What is the expected behaviour

the sidebar sync scroll always.

Other relevant information

  • Bug does still occur when all/other plugins are disabled?

  • Your OS:

  • Node.js version:

  • npm/yarn version:

  • Browser version:

  • Docsify version:

  • Docsify plugins:

Please create a reproducible sandbox

Edit 307qqv236

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

@vagra
Copy link
Contributor Author

vagra commented Apr 24, 2020

if I don't click the left sidebar item, when refresh the page using F5, I always sync scroll.

@vagra
Copy link
Contributor Author

vagra commented Apr 24, 2020

see this code in scroll.js

export function scrollActiveSidebar(router) {

  const path = router.getCurrentPath();
  console.log(path);  // log info for test
  dom.off('scroll', () => highlight(path));
  dom.on('scroll', () => highlight(path));

}

if I don't click the links at main content or side bar, the path is :

/docs/pagename

if I clicked the links at main content or side bar, the path is:

/docs/pagename?id=anchorid

but in the function highlight(path) , does not handle the id in path.

vagra added a commit to vagra/docsify that referenced this issue Apr 24, 2020
This was referenced Apr 24, 2020
@anikethsaha anikethsaha added the bug confirmed as a bug label May 3, 2020
anikethsaha added a commit that referenced this issue May 3, 2020
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

Successfully merging a pull request may close this issue.

2 participants