From ac2330cc91d8021c5c22f6bbae601a8da7bafe79 Mon Sep 17 00:00:00 2001 From: greta Date: Fri, 12 Sep 2025 17:41:21 +0200 Subject: [PATCH] fix: thread scrolling position Signed-off-by: greta --- src/components/ThreadEnvelope.vue | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/components/ThreadEnvelope.vue b/src/components/ThreadEnvelope.vue index 5b6552ccd9..5628dbcf34 100644 --- a/src/components/ThreadEnvelope.vue +++ b/src/components/ThreadEnvelope.vue @@ -19,7 +19,9 @@ -
+
{ const threadElement = document.querySelector(`[data-thread-id="${threadId}"]`) if (threadElement) { - threadElement.scrollIntoView({ behavior: 'smooth', block: 'top' }) + threadElement.scrollIntoView({ + behavior: 'smooth', + block: 'start', + }) } }) }, scrollToEnvelope() { this.$nextTick(() => { - const envelopeElement = this.$refs.envelope - if (envelopeElement) { - envelopeElement.scrollIntoView({ behavior: 'smooth', block: 'top' }) + const envelopeHeaderElement = this.$refs.header + const subjectElement = document.querySelector('#mail-thread-header') + + if (envelopeHeaderElement) { + if (subjectElement) { + const subjectHeight = subjectElement.offsetHeight + envelopeHeaderElement.style.scrollMarginTop = `${subjectHeight}px` + } + envelopeHeaderElement.scrollIntoView({ behavior: 'smooth', block: 'start', container: 'nearest' }) } }) },