From d25c3ff4fcd55405295e3d12892e9969c0c1e6ac Mon Sep 17 00:00:00 2001 From: Ajay Bura Date: Fri, 11 Mar 2022 14:04:44 +0530 Subject: [PATCH] Fix pressing crtl/alt key jump to highlighted msg (#344) Signed-off-by: Ajay Bura --- src/app/molecules/message/Message.jsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/app/molecules/message/Message.jsx b/src/app/molecules/message/Message.jsx index 9c596e1..c011be7 100644 --- a/src/app/molecules/message/Message.jsx +++ b/src/app/molecules/message/Message.jsx @@ -150,10 +150,13 @@ const MessageReplyWrapper = React.memo(({ roomTimeline, eventId }) => { }; }, []); - const focusReply = () => { - if (reply?.event === null) return; - if (reply?.event.isRedacted()) return; - roomTimeline.loadEventTimeline(eventId); + const focusReply = (ev) => { + if (!ev.keyCode || ev.keyCode === 32 || ev.keyCode === 13) { + if (ev.keyCode) ev.preventDefault(); + if (reply?.event === null) return; + if (reply?.event.isRedacted()) return; + roomTimeline.loadEventTimeline(eventId); + } }; return (