File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change 2121 </div >
2222 </div >
2323
24- <div class =" envelope__header" >
24+ <div
25+ ref =" header"
26+ class =" envelope__header" >
2527 <div class =" envelope__header__avatar" >
2628 <Avatar
2729 v-if =" envelope.from && envelope.from[0]"
@@ -842,16 +844,25 @@ export default {
842844 this .$nextTick (() => {
843845 const threadElement = document .querySelector (` [data-thread-id="${ threadId} "]` )
844846 if (threadElement) {
845- threadElement .scrollIntoView ({ behavior: ' smooth' , block: ' top' })
847+ threadElement .scrollIntoView ({
848+ behavior: ' smooth' ,
849+ block: ' start' ,
850+ })
846851 }
847852 })
848853 },
849854
850855 scrollToEnvelope () {
851856 this .$nextTick (() => {
852- const envelopeElement = this .$refs .envelope
853- if (envelopeElement) {
854- envelopeElement .scrollIntoView ({ behavior: ' smooth' , block: ' top' })
857+ const envelopeHeaderElement = this .$refs .header
858+ const subjectElement = document .querySelector (' #mail-thread-header' )
859+
860+ if (envelopeHeaderElement) {
861+ if (subjectElement) {
862+ const subjectHeight = subjectElement .offsetHeight
863+ envelopeHeaderElement .style .scrollMarginTop = ` ${ subjectHeight} px`
864+ }
865+ envelopeHeaderElement .scrollIntoView ({ behavior: ' smooth' , block: ' start' , container: ' nearest' })
855866 }
856867 })
857868 },
You can’t perform that action at this time.
0 commit comments