Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

fix: issue description was not rendering in the issue create/edit modal (#4122)

guru_sainath3742ea91bf2c
diff --git a/web/components/issues/issue-modal/form.tsx b/web/components/issues/issue-modal/form.tsx
index 235d33b5f2..ed8a562c31 100644
--- a/web/components/issues/issue-modal/form.tsx
+++ b/web/components/issues/issue-modal/form.tsx
@@ -461,34 +461,36 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
/>
)}
</div>
- <Controller
- name="description_html"
- control={control}
- render={({ field: { value, onChange } }) => (
- <RichTextEditorWithRef
- cancelUploadImage={fileService.cancelUpload}
- uploadFile={fileService.getUploadFileFunction(workspaceSlug as string)}
- deleteFile={fileService.getDeleteImageFunction(workspaceId)}
- restoreFile={fileService.getRestoreImageFunction(workspaceId)}
- ref={editorRef}
- debouncedUpdatesEnabled={false}
- value={
- !value || value === "" || (typeof value === "object" && Object.keys(value).length === 0)
- ? watch("description_html")
- : value
- }
- initialValue={data?.description_html}
- customClassName="min-h-[7rem] border-custom-border-100"
- onChange={(description: any, description_html: string) => {
- onChange(description_html);
- handleFormChange();
- }}
- mentionHighlights={mentionHighlights}
- mentionSuggestions={mentionSuggestions}
- tabIndex={getTabIndex("description_html")}
- />
- )}
- />
+ {data?.description_html && watch("description_html") && (
+ <Controller
+ name="description_html"
+ control={control}
+ render={({ field: { value, onChange } }) => (
+ <RichTextEditorWithRef
+ cancelUploadImage={fileService.cancelUpload}
+ uploadFile={fileService.getUploadFileFunction(workspaceSlug as string)}
+ deleteFile={fileService.getDeleteImageFunction(workspaceId)}
+ restoreFile={fileService.getRestoreImageFunction(workspaceId)}
+ ref={editorRef}
+ debouncedUpdatesEnabled={false}
+ value={
+ !value || value === "" || (typeof value === "object" && Object.keys(value).length === 0)
+ ? watch("description_html")
+ : value
+ }
+ initialValue={data?.description_html}
+ customClassName="min-h-[7rem] border-custom-border-100"
+ onChange={(description: any, description_html: string) => {
+ onChange(description_html);
+ handleFormChange();
+ }}
+ mentionHighlights={mentionHighlights}
+ mentionSuggestions={mentionSuggestions}
+ tabIndex={getTabIndex("description_html")}
+ />
+ )}
+ />
+ )}
</Fragment>
)}
</div>
diff --git a/web/components/issues/issue-modal/modal.tsx b/web/components/issues/issue-modal/modal.tsx
index 29633918fc..8bb4e972a3 100644
--- a/web/components/issues/issue-modal/modal.tsx
+++ b/web/components/issues/issue-modal/modal.tsx
@@ -75,6 +75,7 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer((prop
const { createIssue, updateIssue } = useIssuesActions(storeType);
const fetchIssueDetail = async (issueId: string | undefined) => {
+ setDescription(undefined);
if (!workspaceSlug) return;
if (!projectId || issueId === undefined) {