Skip to content

Conversation

@idontknowjs
Copy link
Contributor

@idontknowjs idontknowjs commented Dec 16, 2020

Fixes #374
Issue was: While visiting any sub heading like this, the scroll position was not correct

Changes:

  1. Tried various methods like checking when DOM is ready with: document.readyState === "complete"
  2. Tried adding defer in <script src="./js/init.js"></script>.
  3. Also with document.querySelector(target).offsetTop, document.querySelector(target) showed null because DOM was not loaded till that time. Like shown below

image

But the above steps were not working as it's expected.
So it only worked by adding a setTimeout() function

Also thanks to @ffd8, for the suggestions

@idontknowjs
Copy link
Contributor Author

@limzykenneth @lmccart can you please review it

@lmccart lmccart merged commit f56a2a4 into processing:main Dec 16, 2020
@idontknowjs idontknowjs deleted the hashError branch December 17, 2020 04:21
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

Successfully merging this pull request may close these issues.

Page doesn't return to correct scroll position.

2 participants