mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
Don't allow blank messages to be sent.
This commit is contained in:
parent
7e42072952
commit
d4147c1315
@ -153,7 +153,12 @@ module.exports = {
|
|||||||
|
|
||||||
onKeyDown: function (ev) {
|
onKeyDown: function (ev) {
|
||||||
if (ev.keyCode === KeyCode.ENTER) {
|
if (ev.keyCode === KeyCode.ENTER) {
|
||||||
this.sentHistory.push(this.refs.textarea.getDOMNode().value);
|
var input = this.refs.textarea.getDOMNode().value;
|
||||||
|
if (input.length === 0) {
|
||||||
|
ev.preventDefault();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.sentHistory.push(input);
|
||||||
this.onEnter(ev);
|
this.onEnter(ev);
|
||||||
}
|
}
|
||||||
else if (ev.keyCode === KeyCode.TAB) {
|
else if (ev.keyCode === KeyCode.TAB) {
|
||||||
|
Loading…
Reference in New Issue
Block a user