From 5ab31d8dbdbcfa52736e2cab2b9bf97cd82ce305 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Wed, 1 Apr 2026 14:13:09 -0500 Subject: [PATCH 1/2] capture focus when replying to messages --- src/app/features/room/RoomInput.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/app/features/room/RoomInput.tsx b/src/app/features/room/RoomInput.tsx index 70eca4dc2..bc30145c8 100644 --- a/src/app/features/room/RoomInput.tsx +++ b/src/app/features/room/RoomInput.tsx @@ -419,6 +419,24 @@ export const RoomInput = forwardRef( } }, [mentionInReplies, mx, replyDraft]); + const prevReplyEventId = useRef(replyDraft?.eventId); + useEffect(() => { + if (replyDraft?.eventId !== prevReplyEventId.current) { + prevReplyEventId.current = replyDraft?.eventId; + + if (replyDraft?.eventId) { + requestAnimationFrame(() => { + try { + ReactEditor.focus(editor); + moveCursor(editor); + } catch { + // Ignore focus errors + } + }); + } + } + }, [replyDraft?.eventId, editor]); + const handleFileMetadata = useCallback( (fileItem: TUploadItem, metadata: TUploadMetadata) => { setSelectedFiles({ From fe09f2a2d2c0964e94c970aaca7875dc94c608b4 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Wed, 1 Apr 2026 16:08:01 -0500 Subject: [PATCH 2/2] add changeset --- .changeset/fix-focus-capture-reply.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fix-focus-capture-reply.md diff --git a/.changeset/fix-focus-capture-reply.md b/.changeset/fix-focus-capture-reply.md new file mode 100644 index 000000000..30b559f9c --- /dev/null +++ b/.changeset/fix-focus-capture-reply.md @@ -0,0 +1,5 @@ +--- +default: patch +--- + +Fix reply button not capturing editor focus.