From 89cee44fdacc79a955c682132edcd5b1a96d321f Mon Sep 17 00:00:00 2001 From: Troplo Date: Sat, 30 Jul 2022 15:26:52 +1000 Subject: [PATCH] Update CommunicationsChat.vue --- frontend/src/views/Communications/CommunicationsChat.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/Communications/CommunicationsChat.vue b/frontend/src/views/Communications/CommunicationsChat.vue index 5b4fd31..819a342 100644 --- a/frontend/src/views/Communications/CommunicationsChat.vue +++ b/frontend/src/views/Communications/CommunicationsChat.vue @@ -812,7 +812,7 @@ export default { } }, methods: { - scrollEvent(e) { + async scrollEvent(e) { this.avoidAutoScroll = e.target.scrollTop + e.target.offsetHeight !== e.target.scrollHeight if ( @@ -824,7 +824,11 @@ export default { this.rateLimit = true this.offset += 50 this.loadingMessages = true - this.getMessages() + const element = document.getElementById("message-0") + await this.getMessages() + if (element) { + element.scrollIntoView() + } setTimeout(() => { this.rateLimit = false }, 250)