forked from github/plane
fix: remirror placeholder (#849)
This commit is contained in:
parent
0beb654069
commit
819508d5fc
@ -46,7 +46,7 @@ const RemirrorRichTextEditor = dynamic(() => import("components/rich-text-editor
|
||||
const defaultValues: Partial<IIssue> = {
|
||||
project: "",
|
||||
name: "",
|
||||
description: "",
|
||||
description: { type: "doc", content: [] },
|
||||
description_html: "<p></p>",
|
||||
estimate_point: null,
|
||||
state: "",
|
||||
@ -137,7 +137,7 @@ export const IssueForm: FC<IssueFormProps> = ({
|
||||
setValue("description_html", `${watch("description_html")}<p>${response}</p>`);
|
||||
};
|
||||
|
||||
const handelAutoGenerateDescription = async () => {
|
||||
const handleAutoGenerateDescription = async () => {
|
||||
if (!workspaceSlug || !projectId) return;
|
||||
|
||||
setIAmFeelingLucky(true);
|
||||
@ -301,7 +301,7 @@ export const IssueForm: FC<IssueFormProps> = ({
|
||||
className={`flex items-center gap-1 rounded px-1.5 py-1 text-xs hover:bg-gray-100 ${
|
||||
iAmFeelingLucky ? "cursor-wait" : ""
|
||||
}`}
|
||||
onClick={handelAutoGenerateDescription}
|
||||
onClick={handleAutoGenerateDescription}
|
||||
disabled={iAmFeelingLucky}
|
||||
>
|
||||
{iAmFeelingLucky ? (
|
||||
|
@ -32,7 +32,8 @@ type Props = {
|
||||
|
||||
const defaultValues = {
|
||||
name: "",
|
||||
description: "<p></p>",
|
||||
description: { type: "doc", content: [] },
|
||||
description_html: "<p></p>",
|
||||
};
|
||||
|
||||
const RemirrorRichTextEditor = dynamic(() => import("components/rich-text-editor"), {
|
||||
|
@ -199,9 +199,11 @@ const RemirrorRichTextEditor: FC<IRemirrorRichTextEditor> = (props) => {
|
||||
onBlur(jsonValue, htmlValue);
|
||||
}}
|
||||
>
|
||||
{(!value || value === "" || value?.content?.[0]?.content === undefined) && placeholder && (
|
||||
<p className="absolute pointer-events-none top-4 left-4 text-gray-300">{placeholder}</p>
|
||||
)}
|
||||
{(!value || value === "" || value?.content?.[0]?.content === undefined) &&
|
||||
!(typeof value === "string" && value.includes("<")) &&
|
||||
placeholder && (
|
||||
<p className="absolute pointer-events-none top-4 left-4 text-gray-300">{placeholder}</p>
|
||||
)}
|
||||
<EditorComponent />
|
||||
|
||||
{imageLoader && (
|
||||
|
Loading…
Reference in New Issue
Block a user