docsifyjs / docsify

🃏 A magical documentation site generator.
https://docsify.js.org
MIT License
27.59k stars 5.67k forks source link

can't jump to right anchor when there are lots of pictures in doc #1753

Open ballever opened 2 years ago

ballever commented 2 years ago

Bug Report

Steps to reproduce

  1. open a page which contains lots of picture
  2. click one head at the bottom of this page
  3. copy this url
  4. open a new page and paste url to page and enter
  5. page loaded and scroll down
  6. finally stops at a place which is not my excpet

if I remove all pictures, every thing works fine

What is current behaviour

page stop at a place, not to right anchor place

What is the expected behaviour

page stop to target anchor

Other relevant information

Please create a reproducible sandbox

Edit 307qqv236

Try jump to https://s7wzo9.csb.app/#/?id=dfdsfdsf

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

trusktr commented 2 years ago

Ah, yeah, that's annoying. It performs the jump calculation before the images are loaded (race condition) so it may not end in the place where it should.

slym commented 9 months ago

Is there any workaround for this issue ?

EDIT : I found a workaround in https://github.com/docsifyjs/docsify/issues/351 but with limited success.