From 8d157ff962ee63e6a7dfddb8ab707ddafbbd0b1f Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Mon, 8 May 2023 22:52:34 -0400 Subject: [PATCH] fix: Re-focus comment input after comment --- app/scenes/Document/components/CommentForm.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/scenes/Document/components/CommentForm.tsx b/app/scenes/Document/components/CommentForm.tsx index 70dfb4649..cde922d94 100644 --- a/app/scenes/Document/components/CommentForm.tsx +++ b/app/scenes/Document/components/CommentForm.tsx @@ -121,7 +121,6 @@ function CommentForm({ setData(undefined); setForceRender((s) => ++s); - setInputFocused(false); const comment = new Comment( { @@ -145,6 +144,11 @@ function CommentForm({ comment.isNew = false; comment.createdById = user.id; comment.createdBy = user; + + // re-focus the comment editor + setTimeout(() => { + editorRef.current?.focusAtStart(); + }, 0); }); const handleChange = (