From bd0186296cb1a9f127b76e4ee0a02f7f6eb4e092 Mon Sep 17 00:00:00 2001
From: Marie <marie@kaifa.ch>
Date: Sat, 3 Feb 2024 21:35:55 +0100
Subject: fix: scrolling to note

---
 packages/frontend/src/components/SkNoteDetailed.vue | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'packages/frontend/src/components/SkNoteDetailed.vue')

diff --git a/packages/frontend/src/components/SkNoteDetailed.vue b/packages/frontend/src/components/SkNoteDetailed.vue
index 54505c9bb7..843f40c0cb 100644
--- a/packages/frontend/src/components/SkNoteDetailed.vue
+++ b/packages/frontend/src/components/SkNoteDetailed.vue
@@ -302,6 +302,7 @@ const isRenote = (
 );
 
 const rootEl = shallowRef<HTMLElement>();
+const noteEl = shallowRef<HTMLElement>();
 const menuButton = shallowRef<HTMLElement>();
 const menuVersionsButton = shallowRef<HTMLElement>();
 const renoteButton = shallowRef<HTMLElement>();
@@ -808,12 +809,12 @@ function setScrolling() {
 onMounted(() => {
 	document.addEventListener('wheel', setScrolling);
 	isScrolling = false;
-	rootEl.value?.scrollIntoView({ block: 'center' });
+	noteEl.value?.scrollIntoView({ block: 'center' });
 });
 
 onUpdated(() => {
 	if (!isScrolling) {
-		rootEl.value?.scrollIntoView({ block: 'center' });
+		noteEl.value?.scrollIntoView({ block: 'center' });
 		if (location.hash) {
 			location.replace(location.hash); // Jump to highlighted reply
 		}
-- 
cgit v1.2.3-freya

