Browse Source

unfocus chat input on enter

main
Stephanie Gredell 5 months ago
parent
commit
caffcebf16
  1. 4
      static/script.js

4
static/script.js

@ -363,7 +363,6 @@ window.addEventListener("DOMContentLoaded", function() {
break; break;
case 'h': case 'h':
case 'l': case 'l':
// avoid redundant work if already true
if (!me.keys) me.keys = {}; if (!me.keys) me.keys = {};
if (!me.keys[e.key]) me.keys[e.key] = true; if (!me.keys[e.key]) me.keys[e.key] = true;
this._sendAction(e.key, 'keyDown') this._sendAction(e.key, 'keyDown')
@ -396,6 +395,9 @@ window.addEventListener("DOMContentLoaded", function() {
if (e.key === 'Enter') { if (e.key === 'Enter') {
this._onSendClick() this._onSendClick()
} }
if (e.key === "Escape" && this._isTypingInChat()) {
this.chatInput.blur();
}
} }
} }

Loading…
Cancel
Save