From 8d009187abf6ac2be8c6b00b99e2682f241f1c0f Mon Sep 17 00:00:00 2001 From: Prateek Shourya Date: Mon, 8 Apr 2024 18:44:04 +0530 Subject: [PATCH] [WEB-916] fix: description editor missing when using create more button in create issue modal. (#4137) * [WEB-916] fix: description editor missing when using create more button in create issue modal. * chore: handle edge cases. * chore: handle edge cases. --- web/components/issues/issue-modal/form.tsx | 3 ++- web/components/issues/issue-modal/modal.tsx | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/web/components/issues/issue-modal/form.tsx b/web/components/issues/issue-modal/form.tsx index ed8a562c3..a713327f6 100644 --- a/web/components/issues/issue-modal/form.tsx +++ b/web/components/issues/issue-modal/form.tsx @@ -193,6 +193,7 @@ export const IssueFormRoot: FC = observer((props) => { reset({ ...defaultValues, project_id: getValues("project_id"), + description_html: data?.description_html ?? "

", }); editorRef?.current?.clearEditor(); }; @@ -481,7 +482,7 @@ export const IssueFormRoot: FC = observer((props) => { initialValue={data?.description_html} customClassName="min-h-[7rem] border-custom-border-100" onChange={(description: any, description_html: string) => { - onChange(description_html); + onChange(description_html === "" ? "

" : description_html); handleFormChange(); }} mentionHighlights={mentionHighlights} diff --git a/web/components/issues/issue-modal/modal.tsx b/web/components/issues/issue-modal/modal.tsx index 8bb4e972a..fc4d7f016 100644 --- a/web/components/issues/issue-modal/modal.tsx +++ b/web/components/issues/issue-modal/modal.tsx @@ -174,6 +174,7 @@ export const CreateUpdateIssueModal: React.FC = observer((prop !createMore && handleClose(); if (createMore) { issueTitleRef && issueTitleRef?.current?.focus(); + setDescription("

"); setChangesMade(null); } return response;