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

Inconsistent ID Anchor Jumps (revisited) #559

Closed
mlschuh opened this issue Jun 29, 2018 · 5 comments
Closed

Inconsistent ID Anchor Jumps (revisited) #559

mlschuh opened this issue Jun 29, 2018 · 5 comments
Labels

Comments

@mlschuh
Copy link

mlschuh commented Jun 29, 2018

Related to #332 but with a reproduced project file.

Attached is a slim version of our project where we were able to reproduce it. docsify-anchor-jump-incorrect.zip

To Reproduce:

npm i docsify-cli -g
docsify serve docs

Go to http://localhost:3000/#/isaac-gui-noimages?id=user-pane and see that it appears close to the anchor.
Go to http://localhost:3000/#/isaac-gui?id=user-pane and see that it appears far from the anchor.

The only difference between the two pages is the images being included or not.

-Mitch

@DixCar
Copy link

DixCar commented Jul 2, 2018

I have noticed similar problem. Some anchors are work correct with sidebar but some aren't.

Below you can see in action: once I have clicked Blockquotes on sidebar the content is scrolling to correct anchor but sidebar indicator jump one level up

ezgif com-video-to-gif

I'm using 'theme-simple-dark'

-Paw

@silentHoo
Copy link

@mlschuh This is the same I'm struggeling with. Problem is that images are async loaded, but docsify doesn't wait until images are present. So if the image has not a given height, the images height is 0 when first visiting the page. If the image is loaded later, the offset between your anchor jump and the current scroll position is exactly the height of the image(s).

@mlschuh
Copy link
Author

mlschuh commented Aug 17, 2018

@silentHoo That makes sense in my mind. I'll ask around to my web dev friends to see if there's a way to at least set some kind of (short) timeout on the anchor jump to at least give the browser a fighting chance of being closer. Tricky part in my mind is to make sure the user still has an impression that the page is loading during that timeout.

@rizdaprasetya
Copy link
Contributor

rizdaprasetya commented Sep 5, 2019

This is what I did to overcome this issue: #351 (comment)

@stale
Copy link

stale bot commented Feb 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

No branches or pull requests

4 participants