feat: scroll down on new messages
This commit is contained in:
parent
bb8114de90
commit
37e2f1d3f2
3
main.js
3
main.js
|
@ -114,6 +114,9 @@ function addMessage(idx) {
|
|||
let message = conversation[idx];
|
||||
let messageHtml = getMessageHtml(message.text, isMessageOurs(message));
|
||||
getMessageList().innerHTML += messageHtml;
|
||||
|
||||
// scroll as far as we can so that messages aren't hidden
|
||||
window.scrollTo(0, document.body.scrollHeight);
|
||||
}
|
||||
|
||||
function getMessageHtml(text, isOurs) {
|
||||
|
|
Loading…
Reference in New Issue