From 33949dbdb13068fef4a9b90216986595ee04aaa5 Mon Sep 17 00:00:00 2001 From: jameskitt616 <52933658+jameskitt616@users.noreply.github.com> Date: Sat, 27 Aug 2022 04:51:41 +0200 Subject: [PATCH] Implement cancel replyto on escape key press (#777) --- src/app/organisms/room/RoomViewInput.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/organisms/room/RoomViewInput.jsx b/src/app/organisms/room/RoomViewInput.jsx index 1f31ead..930eae1 100644 --- a/src/app/organisms/room/RoomViewInput.jsx +++ b/src/app/organisms/room/RoomViewInput.jsx @@ -263,6 +263,11 @@ function RoomViewInput({ }; const handleKeyDown = (e) => { + if (e.key === 'Escape') { + e.preventDefault(); + roomsInput.cancelReplyTo(roomId); + setReplyTo(null); + } if (e.key === 'Enter' && e.shiftKey === false) { e.preventDefault(); sendMessage(); @@ -421,6 +426,7 @@ function RoomViewInput({ />