diff options
author | Maksim Sukharev <antreesy.web@gmail.com> | 2023-07-12 15:26:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-12 15:26:31 +0200 |
commit | 98dd07a79de1bbcf17806f102741d1b7d7eb126e (patch) | |
tree | 5489db4deee204233e1db9e3352309902d92fb98 /src | |
parent | ca2bd301da46f5117ae64835926e032c53a0fc94 (diff) | |
parent | c542e131ef0697173ee4e14697f75e56a2703400 (diff) |
Merge pull request #9956 from nextcloud/backport/9895/stable27
[stable27] fix(MessagesList) - scroll sticky list to bottom, if reaction was added
Diffstat (limited to 'src')
-rw-r--r-- | src/components/MessagesList/MessagesGroup/Message/Message.vue | 5 | ||||
-rw-r--r-- | src/components/MessagesList/MessagesList.vue | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/components/MessagesList/MessagesGroup/Message/Message.vue b/src/components/MessagesList/MessagesGroup/Message/Message.vue index 5174be0bb..5243f01d6 100644 --- a/src/components/MessagesList/MessagesGroup/Message/Message.vue +++ b/src/components/MessagesList/MessagesGroup/Message/Message.vue @@ -671,6 +671,11 @@ export default { showJoinCallButton() { EventBus.$emit('scroll-chat-to-bottom') }, + + // Scroll list to the bottom if reaction to the message was added, as it expands the list + simpleReactions() { + EventBus.$emit('scroll-chat-to-bottom-if-sticky') + }, }, mounted() { diff --git a/src/components/MessagesList/MessagesList.vue b/src/components/MessagesList/MessagesList.vue index 152c389cc..38aaa5332 100644 --- a/src/components/MessagesList/MessagesList.vue +++ b/src/components/MessagesList/MessagesList.vue @@ -282,6 +282,7 @@ export default { this.scrollToBottom() EventBus.$on('scroll-chat-to-bottom', this.handleScrollChatToBottomEvent) EventBus.$on('smooth-scroll-chat-to-bottom', this.smoothScrollToBottom) + EventBus.$on('scroll-chat-to-bottom-if-sticky', this.scrollToBottomIfSticky) EventBus.$on('focus-message', this.focusMessage) EventBus.$on('route-change', this.onRouteChange) subscribe('networkOffline', this.handleNetworkOffline) @@ -300,6 +301,7 @@ export default { window.removeEventListener('focus', this.onWindowFocus) EventBus.$off('scroll-chat-to-bottom', this.handleScrollChatToBottomEvent) EventBus.$off('smooth-scroll-chat-to-bottom', this.smoothScrollToBottom) + EventBus.$on('scroll-chat-to-bottom-if-sticky', this.scrollToBottomIfSticky) EventBus.$off('focus-message', this.focusMessage) EventBus.$off('route-change', this.onRouteChange) @@ -891,6 +893,15 @@ export default { }, /** + * Scrolls to the bottom of the list (to show reaction to the last message). + */ + scrollToBottomIfSticky() { + if (this.isSticky) { + this.scrollToBottom() + } + }, + + /** * Scrolls to the bottom of the list smoothly. */ smoothScrollToBottom() { |