This commit is contained in:
tamaina 2023-07-13 05:48:18 +00:00
parent 130ece74f9
commit 68d647d6b8

View file

@ -233,6 +233,8 @@ watch([$$(weakBacked), $$(contentEl)], () => {
function adjustScroll(fn: () => void): Promise<void> { function adjustScroll(fn: () => void): Promise<void> {
const oldHeight = scrollableElement ? scrollableElement.scrollHeight : getBodyScrollHeight(); const oldHeight = scrollableElement ? scrollableElement.scrollHeight : getBodyScrollHeight();
const oldScroll = scrollableElement ? scrollableElement.scrollTop : window.scrollY; const oldScroll = scrollableElement ? scrollableElement.scrollTop : window.scrollY;
//
scroll(scrollableElement, { top: oldScroll, behavior: 'instant' });
fn(); fn();
return nextTick(() => { return nextTick(() => {