Merge pull request #21 from H4CK3R-01/chat_fix

Send message on pressing enter
This commit is contained in:
H4CK3R-01
2021-06-11 08:50:58 +02:00
committed by GitHub

View File

@@ -67,4 +67,11 @@ function addChatMessage(data) {
messageDiv.appendChild(messageBody);
document.getElementById('messages_received').append(messageDiv);
}
}
document.getElementById('message_input').onkeydown = function (e) {
if (e.key === "Enter") {
sendMessage();
e.preventDefault();
}
};