fix: Draft comment on text gets into a strange state when unfocused

This commit is contained in:
Tom Moor
2023-04-04 23:06:07 -04:00
parent 1b11cb5aca
commit 3ca86bcc0c
2 changed files with 5 additions and 4 deletions

View File

@@ -68,7 +68,9 @@ function CommentThread({
comment: thread,
});
const commentsInThread = comments.inThread(thread.id);
const commentsInThread = comments
.inThread(thread.id)
.filter((comment) => !comment.isNew);
useOnClickOutside(topRef, (event) => {
if (
@@ -180,7 +182,7 @@ function CommentThread({
},
}}
>
{focused && (
{(focused || commentsInThread.length === 0) && (
<Fade timing={100}>
<CommentForm
documentId={document.id}