mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-30 13:43:08 +02:00
????
This commit is contained in:
parent
78944bf441
commit
5a5ef7564a
1 changed files with 2 additions and 3 deletions
|
@ -239,15 +239,14 @@ 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;
|
||||||
|
|
||||||
denyMoveTransition.value = true;
|
denyMoveTransition.value = true;
|
||||||
|
|
||||||
fn();
|
fn();
|
||||||
|
|
||||||
return nextTick(() => {
|
return nextTick(() => {
|
||||||
const diff = (scrollableElement ? scrollableElement.scrollHeight : getBodyScrollHeight()) - oldHeight;
|
const top = oldScroll + ((scrollableElement ? scrollableElement.scrollHeight : getBodyScrollHeight()) - oldHeight);
|
||||||
const newScroll = scrollableElement ? scrollableElement.scrollTop : window.scrollY;
|
|
||||||
const top = newScroll + diff;
|
|
||||||
scroll(scrollableElement, { top, behavior: 'instant' });
|
scroll(scrollableElement, { top, behavior: 'instant' });
|
||||||
|
|
||||||
denyMoveTransition.value = false;
|
denyMoveTransition.value = false;
|
||||||
|
|
Loading…
Reference in a new issue