diff --git a/src/snek/static/chat-input.js b/src/snek/static/chat-input.js index 61648c1..4fd2845 100644 --- a/src/snek/static/chat-input.js +++ b/src/snek/static/chat-input.js @@ -36,7 +36,10 @@ class ChatInputElement extends HTMLElement { if (e.key == 'Enter') { if(!e.shiftKey){ e.preventDefault() - this.dispatchEvent(new CustomEvent("submit", { detail: e.target.value, bubbles: true })) + const message = e.target.value.trim(); + if(!message) + return + this.dispatchEvent(new CustomEvent("submit", { detail: message, bubbles: true })) e.target.value = '' } }