Revert "Fix: New md file scrolls to Top. (#164999)" (#168224)

This reverts commit 54543cf5bf.
This commit is contained in:
Matt Bierner 2022-12-06 13:50:30 -08:00 committed by GitHub
parent 94acd2c085
commit ac88f33e2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View file

@ -57,12 +57,12 @@ function doAfterImagesLoaded(cb: () => void) {
}
onceDocumentLoaded(() => {
const scrollTo = !isNaN(state.line) ? state.line : state.scrollProgress;
const scrollProgress = state.scrollProgress;
if (typeof scrollTo === 'number' && !settings.settings.fragment) {
if (typeof scrollProgress === 'number' && !settings.settings.fragment) {
doAfterImagesLoaded(() => {
scrollDisabledCount += 1;
window.scrollTo(0, scrollTo * document.body.clientHeight);
window.scrollTo(0, scrollProgress * document.body.clientHeight);
});
return;
}

View file

@ -755,8 +755,6 @@ export class DynamicMarkdownPreview extends Disposable implements IManagedMarkdo
default:
return;
}
} else if (!scrollLocation) {
scrollLocation = new StartingScrollLine(0);
}
this._preview.dispose();