fixed modal form issue

This commit is contained in:
Palanikannan1437 2023-10-03 19:59:09 +05:30
parent ff29c1c87e
commit 99618e93a7

View File

@ -379,30 +379,23 @@ export const IssueForm: FC<IssueFormProps> = (props) => {
<Controller <Controller
name="description_html" name="description_html"
control={control} control={control}
render={({ field: { value, onChange } }) => { render={({ field: { value, onChange } }) => (
if (!value && !watch("description_html")) return <></>;
return (
<RichTextEditorWithRef <RichTextEditorWithRef
uploadFile={fileService.getUploadFileFunction(workspaceSlug as string)} uploadFile={fileService.getUploadFileFunction(workspaceSlug as string)}
deleteFile={fileService.deleteImage} deleteFile={fileService.deleteImage}
ref={editorRef} ref={editorRef}
debouncedUpdatesEnabled={false} debouncedUpdatesEnabled={false}
value={ value={!value ||
!value ||
value === "" || value === "" ||
(typeof value === "object" && Object.keys(value).length === 0) (typeof value === "object" && Object.keys(value).length === 0)
? watch("description_html") ? watch("description_html")
: value : value}
}
customClassName="min-h-[150px]" customClassName="min-h-[150px]"
onChange={(description: Object, description_html: string) => { onChange={(description: Object, description_html: string) => {
onChange(description_html); onChange(description_html);
setValue("description", description); setValue("description", description);
}} } } />
/> )}
);
}}
/> />
<GptAssistantModal <GptAssistantModal
isOpen={gptAssistantModal} isOpen={gptAssistantModal}