Skip to content

A platform for community discussion. Free, open, simple.

UX: scroll to bottom when message is staged (#21408)

Joffrey JAFFEUX78616404cea9
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-thread.js b/plugins/chat/assets/javascripts/discourse/components/chat-thread.js
index 2b5d6e6e74c..d0513a2326d 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat-thread.js
+++ b/plugins/chat/assets/javascripts/discourse/components/chat-thread.js
@@ -190,6 +190,8 @@ export default class ChatThreadPanel extends Component {
this.resetComposer();
this.thread.messagesManager.addMessages([stagedMessage]);
+ this.scrollToBottom();
+
return this.chatApi
.sendMessage(this.channel.id, {
message: stagedMessage.message,
@@ -199,9 +201,6 @@ export default class ChatThreadPanel extends Component {
thread_id: this.thread.staged ? null : stagedMessage.thread.id,
staged_thread_id: this.thread.staged ? stagedMessage.thread.id : null,
})
- .then(() => {
- this.scrollToBottom();
- })
.catch((error) => {
this.#onSendError(stagedMessage.id, error);
})