Uh oh!
There was an error while loading. Please reload this page.
feat(scroll): smarter scroll behavior - #744
Conversation
timaschew
commented
Apr 13, 2019
Please run these commands to trigger netlify deployment for this Pull Request: git commit --amend --no-edit
git push --force |
solymosi
commented
Apr 13, 2019
@timaschew Done. |
timaschew
commented
Apr 21, 2019
Hey @solymosi, FYI: the DNS for the preview has changed: https://deploy-preview-744--docsifyjs.netlify.com
I totally agree with you. I've just tried some actions:
Expected: Scroll position at pagination When using Also I don't understand how auto2top: false can be useful. For me it's broken because if you open another page the scroll position is only correct if you didn't scroll on the previous page, which is mostly not the case. Or do I miss anything? (This is of course not directly related to your PR) |
solymosi
commented
Apr 22, 2019
Hmm... that looks like a bug, and it's reliably reproducable when:
I guess the reason is that the browser's scroll restoration behavior is invoked before the old page is properly replaced with the new one by Docsify and therefore the target scroll position is capped at the height of the old page. The fact that it's only triggered when using the The problem is that this may require implementing our own custom scroll restoration behavior and turning off the browser's default: https://developers.google.com/web/updates/2015/09/history-api-scroll-restoration. But I'd need to do some digging first because there might be a simpler workaround as well. In any case, I'd recommend addressing this particular issue in a different PR.
I have no idea how it's useful either, but since it existed I assumed there was at least some reason for it, so I kept it in there. Totally fine with removing it, however. |
timaschew
commented
Apr 23, 2019
Merging this PR before the other one, actually let's say publishing a new version based on this PR would be a regression. Because currently it's working fine for URLs with an ID. Regarding /cc @jhildenbiddle |
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. |
anikethsaha
commented
Feb 4, 2020
cc @solymosi whats the status on this ? |
solymosi
commented
Feb 4, 2020
Let me rebase this and resolve the conflicts. After that it can be merged, unless you'd like me to make additional changes. |
90c5850 to
d160e93Comparesolymosi
commented
Feb 4, 2020
Rebased and fixed up the whitespace style to match that of the |
anikethsaha
commented
Feb 4, 2020
I will review it soon cc @timaschew your thoughts ? |
d160e93 to
2964305Comparesolymosi
commented
Feb 26, 2020
Rebased again due to merge conflicts. Any updates on the review? |
anikethsaha
commented
Feb 26, 2020
can you please fix the CI issue. |
2964305 to
23060c9Comparesolymosi
commented
Feb 26, 2020
Linting issues fixed ✔️ – couldn't do anything about the "security flow", that step seems to be broken. |
Currently Docsify has the following behavior when it comes to scrolling:
auto2topis enabled then:auto2topis disabled then:Ideally, the following should happen (in my opinion):
This PR implements this (in my opinion better) behavior for both the
hashand thehistoryrouter modes. Scrolling to the top only happens ifauto2topis enabled.It does not attempt to fix the inconsistent scrolling issue that's caused by images loaded asynchronously.
masterbranch.libdirectory.