From e92417037ccd859f54c2efac62da2a028ce3bc53 Mon Sep 17 00:00:00 2001 From: Prateek Shourya Date: Thu, 22 Feb 2024 20:01:42 +0530 Subject: [PATCH] [WEB-496] improvement: disable submit button when there is no text in comment box. (#3754) --- .../issue-activity/comments/comment-create.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 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 bf5b15266..f7bce3edc 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 @@ -53,7 +53,8 @@ export const IssueCommentCreate: FC = (props) => { control, formState: { isSubmitting }, reset, - } = useForm>({ defaultValues: { comment_html: "

" } }); + watch, + } = useForm>({ defaultValues: { comment_html: "" } }); const onSubmit = async (formData: Partial) => { await activityOperations.createComment(formData).finally(() => { @@ -88,7 +89,7 @@ export const IssueCommentCreate: FC = (props) => { deleteFile={fileService.getDeleteImageFunction(workspaceId)} restoreFile={fileService.getRestoreImageFunction(workspaceId)} ref={editorRef} - value={!value ? "

" : value} + value={value ?? ""} customClassName="p-2" editorContentCustomClassNames="min-h-[35px]" debouncedUpdatesEnabled={false} @@ -104,7 +105,7 @@ export const IssueCommentCreate: FC = (props) => { } submitButton={