mirror of https://github.com/FreeTubeApp/FreeTube
Evaluate live chat scroll check on scrollend (#5302)
This commit is contained in:
parent
5c390dada5
commit
4592b18db9
|
@ -306,7 +306,7 @@ export default defineComponent({
|
|||
}
|
||||
},
|
||||
|
||||
onScroll: function (event) {
|
||||
onScroll: function (event, isScrollEnd = false) {
|
||||
const liveChatComments = this.$refs.liveChatComments
|
||||
if (event.wheelDelta >= 0 && this.stayAtBottom) {
|
||||
this.stayAtBottom = false
|
||||
|
@ -314,10 +314,8 @@ export default defineComponent({
|
|||
if (liveChatComments.scrollHeight > liveChatComments.clientHeight) {
|
||||
this.showScrollToBottom = true
|
||||
}
|
||||
} else if (event.wheelDelta < 0 && !this.stayAtBottom) {
|
||||
if ((liveChatComments.scrollHeight - liveChatComments.scrollTop) === liveChatComments.clientHeight) {
|
||||
this.scrollToBottom()
|
||||
}
|
||||
} else if ((isScrollEnd || event.wheelDelta < 0) && !this.stayAtBottom && (liveChatComments.scrollHeight - liveChatComments.scrollTop) === liveChatComments.clientHeight) {
|
||||
this.scrollToBottom()
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -128,6 +128,7 @@
|
|||
class="liveChatComments"
|
||||
:style="{ blockSize: chatHeight }"
|
||||
@mousewheel="e => onScroll(e)"
|
||||
@scrollend="e => onScroll(e, true)"
|
||||
>
|
||||
<div
|
||||
v-for="(comment, index) in comments"
|
||||
|
|
Loading…
Reference in New Issue