fix: issue comment validation (#4211)

This commit is contained in:
Anmol Singh Bhatia
2024-04-16 18:50:26 +05:30
committed by GitHub
parent 2ab4d99c15
commit 59772be014

View File

@@ -50,7 +50,11 @@ export const IssueCommentCreate: FC<TIssueCommentCreate> = (props) => {
});
const commentHTML = watch("comment_html");
const isEmpty = commentHTML?.trim() === "" || commentHTML === "<p></p>" || isEmptyHtmlString(commentHTML ?? "");
const isEmpty =
commentHTML?.trim() === "" ||
commentHTML === "<p></p>" ||
(isEmptyHtmlString(commentHTML ?? "") && !commentHTML?.includes("mention-component"));
return (
<div
@@ -70,7 +74,9 @@ export const IssueCommentCreate: FC<TIssueCommentCreate> = (props) => {
workspaceId={workspaceId}
projectId={projectId}
workspaceSlug={workspaceSlug}
onEnterKeyPress={(e) => handleSubmit(onSubmit)(e)}
onEnterKeyPress={(e) => {
if (!isEmpty && !isSubmitting) handleSubmit(onSubmit)(e);
}}
ref={editorRef}
initialValue={value ?? "<p></p>"}
containerClassName="min-h-[35px]"