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

Loading…
Cancel
Save