diff --git a/api_webchat/messageInput.js b/api_webchat/messageInput.js index 944fbcbb..4533ac43 100644 --- a/api_webchat/messageInput.js +++ b/api_webchat/messageInput.js @@ -138,6 +138,10 @@ class MessageInput extends HTMLElement { } _handleNewChatMessage() { + //do nothing if input is empty + if ((!this._messageInputField.value)||(this._messageInputField.value.trim().length === 0)) { + return; + } // prevent user from interacting while we're waiting this._sendButton.setAttribute('disabled', 'disabled'); this._messageInputField.setAttribute('disabled', 'disabled');