1
Fork 0

Instantiate box explicitly.

Thanks to Antonin Décimo.
This commit is contained in:
Juliusz Chroboczek 2020-05-11 02:58:48 +02:00
parent 8257a7ff19
commit fbf26be8c6
1 changed files with 2 additions and 2 deletions

View File

@ -809,8 +809,8 @@ function addToChatbox(peerId, nick, message, me){
delete(lastMessage.peerId);
}
document.getElementById('box').appendChild(container);
let box = document.getElementById('box');
box.appendChild(container);
if(box.scrollHeight > box.clientHeight) {
box.scrollTop = box.scrollHeight - box.clientHeight;
}