added an event listener on enter key to have it as send

This commit is contained in:
Ethan Fraenkel
2018-09-06 12:33:22 +01:00
parent a0672654b1
commit 4899ac5ec7
4 changed files with 26 additions and 9 deletions

View File

@@ -100,3 +100,4 @@ if (acceptButton) {
document.getElementById('chat-room-id').value = chatRoomId
})
}

View File

@@ -220,3 +220,18 @@ setTimeout(function() {
window.__proto__.reload = () => { window.location = window.location }
})();
// // have enter with JS
// const form = document.getElementById("chat-form")
// document.getElementById("chat-input").addEventListener("keyup", event => {
// if(event == "Enter"){
// form.submit();
// }
// });
document.getElementById("chat-form").addEventListener("click", function(event){
event.preventDefault()
});