From: jameskitt616 <52933658+jameskitt616@users.noreply.github.com> Date: Sat, 27 Aug 2022 02:51:41 +0000 (+0200) Subject: Implement cancel replyto on escape key press (#777) X-Git-Tag: v2.2.0~51 X-Git-Url: https://git.wafflesoft.org/?a=commitdiff_plain;h=33949dbdb13068fef4a9b90216986595ee04aaa5;p=cinny.git Implement cancel replyto on escape key press (#777) --- 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({ />