diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-composer.hbs b/plugins/chat/assets/javascripts/discourse/components/chat-composer.hbs index 95325f10fcf..57a44790854 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-composer.hbs +++ b/plugins/chat/assets/javascripts/discourse/components/chat-composer.hbs @@ -10,7 +10,7 @@ {{/if}} diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-composer.js b/plugins/chat/assets/javascripts/discourse/components/chat-composer.js index 25e27a15a03..4bce7b50170 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-composer.js +++ b/plugins/chat/assets/javascripts/discourse/components/chat-composer.js @@ -191,14 +191,12 @@ export default Component.extend(TextareaTextManipulation, { this.paneService?.editLastMessageRequested(); } - if (event.keyCode === 27) { - // keyCode for 'Escape' + if (event.key === "Escape") { if (this.composerService?.replyToMsg) { this.set("value", ""); this.composerService?.setReplyTo(null); return false; } else if (this.composerService?.editingMessage) { - this.set("value", ""); this.cancelEditing(); return false; } else { @@ -719,6 +717,7 @@ export default Component.extend(TextareaTextManipulation, { @action cancelEditing() { this.composerService?.cancelEditing(); + this.set("value", ""); this._focusTextArea({ ensureAtEnd: true, resizeTextarea: true }); }, diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-live-pane.hbs b/plugins/chat/assets/javascripts/discourse/components/chat-live-pane.hbs index 8e3e8b912e4..0ad94728c19 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-live-pane.hbs +++ b/plugins/chat/assets/javascripts/discourse/components/chat-live-pane.hbs @@ -79,7 +79,6 @@ {{#if (or @channel.isDraft @channel.isFollowing)}}