From 59772be014b3a2495b9f6abaf7f3ee02cb8a1bc2 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Tue, 16 Apr 2024 18:50:26 +0530 Subject: [PATCH] fix: issue comment validation (#4211) --- .../issue-activity/comments/comment-create.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web/components/issues/issue-detail/issue-activity/comments/comment-create.tsx b/web/components/issues/issue-detail/issue-activity/comments/comment-create.tsx index 6261e693a..0263a37e1 100644 --- a/web/components/issues/issue-detail/issue-activity/comments/comment-create.tsx +++ b/web/components/issues/issue-detail/issue-activity/comments/comment-create.tsx @@ -50,7 +50,11 @@ export const IssueCommentCreate: FC = (props) => { }); const commentHTML = watch("comment_html"); - const isEmpty = commentHTML?.trim() === "" || commentHTML === "

" || isEmptyHtmlString(commentHTML ?? ""); + + const isEmpty = + commentHTML?.trim() === "" || + commentHTML === "

" || + (isEmptyHtmlString(commentHTML ?? "") && !commentHTML?.includes("mention-component")); return (
= (props) => { workspaceId={workspaceId} projectId={projectId} workspaceSlug={workspaceSlug} - onEnterKeyPress={(e) => handleSubmit(onSubmit)(e)} + onEnterKeyPress={(e) => { + if (!isEmpty && !isSubmitting) handleSubmit(onSubmit)(e); + }} ref={editorRef} initialValue={value ?? "

"} containerClassName="min-h-[35px]"