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

Sidebar can't scroll to current active section #1067

Closed
lihz6 opened this issue Oct 11, 2019 · 3 comments
Closed

Sidebar can't scroll to current active section #1067

lihz6 opened this issue Oct 11, 2019 · 3 comments

Comments

@lihz6
Copy link
Contributor

lihz6 commented Oct 11, 2019

Sidebar on the left can't auto scroll to the current active section. This is something to do with the book.js. I'm ready to propose a PR.

lihz6 added a commit to lihz6/mdBook that referenced this issue Oct 11, 2019
@mrec
Copy link

mrec commented Oct 14, 2019

Hi - I'm not an mdBook maintainer and have no authoritah over PRs, but wanted to mention that scrollIntoViewIfNeeded is nonstandard and very poorly supported. Does the standard scrollIntoView not work here?

@lihz6
Copy link
Contributor Author

lihz6 commented Oct 15, 2019

Hi - I'm not an mdBook maintainer and have no authoritah over PRs, but wanted to mention that scrollIntoViewIfNeeded is nonstandard and very poorly supported. Does the standard scrollIntoView not work here?

Now it's .scrollIntoView({ block: 'center' });.

ehuss pushed a commit to ehuss/mdBook that referenced this issue Mar 9, 2020
Dylan-DPC-zz pushed a commit that referenced this issue Mar 24, 2020
* Fix: Scroll sidebar to current active section (#1067)

* Clean: Some code related to PR #1052

* Change `scrollIntoViewIfNeeded` with `scrollIntoView`

* Don't use onload event for sidebar scroll to reduce flickering.

Co-authored-by: 李鸿章 <poodll@163.com>
@ehuss
Copy link
Contributor

ehuss commented Apr 21, 2020

I think this should be more-or-less fixed with #1052 and #1161.

@ehuss ehuss closed this as completed Apr 21, 2020
Ruin0x11 pushed a commit to Ruin0x11/mdBook that referenced this issue Aug 30, 2020
* Fix: Scroll sidebar to current active section (rust-lang#1067)

* Clean: Some code related to PR rust-lang#1052

* Change `scrollIntoViewIfNeeded` with `scrollIntoView`

* Don't use onload event for sidebar scroll to reduce flickering.

Co-authored-by: 李鸿章 <poodll@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants