prevent to send empty messages
This commit is contained in:
parent
ecf4a7a167
commit
2646009826
1 changed files with 4 additions and 0 deletions
|
|
@ -138,6 +138,10 @@ class MessageInput extends HTMLElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
_handleNewChatMessage() {
|
_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
|
// prevent user from interacting while we're waiting
|
||||||
this._sendButton.setAttribute('disabled', 'disabled');
|
this._sendButton.setAttribute('disabled', 'disabled');
|
||||||
this._messageInputField.setAttribute('disabled', 'disabled');
|
this._messageInputField.setAttribute('disabled', 'disabled');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue