Skip to content

Commit

Permalink
feat: auto scroll to the bottom on msg receive
Browse files Browse the repository at this point in the history
  • Loading branch information
rasulov1337 committed Dec 17, 2024
1 parent af2b02c commit 7dd2ad3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/ChatWindow/ChatWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ export default class ChatWindow extends BaseComponent {
console.log(`[message] Данные получены с сервера: ${message}`);
if ('content' in message) {
this.addNewMessageElement(message);

this.messagesContainer.scrollTop =
this.messagesContainer.scrollHeight;
} else {
console.log('other type of message');
}
Expand Down

0 comments on commit 7dd2ad3

Please sign in to comment.