Merge pull request #10039 from nextcloud/fix/noid/check-ref-before-scroll

fix(MessagesList) - check if list is rendered before scrolling
This commit is contained in:
Maksim Sukharev
2023-07-24 09:59:24 +02:00
committed by GitHub

View File

@ -945,7 +945,11 @@ export default {
* Scrolls to the bottom of the list smoothly.
*/
smoothScrollToBottom() {
this.$nextTick(function() {
this.$nextTick(() => {
if (!this.$refs.scroller) {
return
}
if (this.isWindowVisible && (document.hasFocus() || this.isInCall)) {
// scrollTo is used when the user is watching
this.$refs.scroller.scrollTo({
@ -970,7 +974,11 @@ export default {
* Scrolls to the bottom of the list.
*/
scrollToBottom() {
this.$nextTick(function() {
this.$nextTick(() => {
if (!this.$refs.scroller) {
return
}
this.$refs.scroller.scrollTop = this.$refs.scroller.scrollHeight
this.setChatScrolledToBottom(true)
})