diff --git a/src/components/MessagesList/MessagesList.vue b/src/components/MessagesList/MessagesList.vue index b7c2aa69549..a5769205e4e 100644 --- a/src/components/MessagesList/MessagesList.vue +++ b/src/components/MessagesList/MessagesList.vue @@ -385,6 +385,9 @@ export default { this.$refs.scroller.scrollTo({ top: this.$refs.scroller.scrollHeight, }) + } else if (this.$refs.scroller.clientHeight === this.$refs.scroller.scrollHeight) { + // chat is not scrollable + this.setChatScrolledToBottom(true) } }, @@ -924,6 +927,8 @@ export default { const scrollOffset = scrollHeight - scrollTop // For chats that are scrolled to bottom and not fitted in one screen + // console.log('scroll', this.hasMoreMessagesToLoad) + // console.log(this.hasMoreMessagesToLoad, this.conversation.lastMessage?.timestamp * 1000, +this.messagesList.at(-1).id.replace('temp-', '')) if (Math.abs(scrollOffset - clientHeight) < SCROLL_TOLERANCE && !this.hasMoreMessagesToLoad && scrollTop > 0) { this.setChatScrolledToBottom(true) this.displayMessagesLoader = false @@ -931,7 +936,9 @@ export default { return } - this.setChatScrolledToBottom(false) + if (scrollHeight > clientHeight) { + this.setChatScrolledToBottom(false) + } if ((scrollHeight > clientHeight && scrollTop < 800 && this.isScrolling === 'up') || skipHeightCheck) { @@ -1118,6 +1125,7 @@ export default { return } + // console.log('check', this.hasMoreMessagesToLoad) let newTop if (options?.force) { newTop = this.$refs.scroller.scrollHeight