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: comment text editor user mention validation addded (#4250)

Anmol Singh Bhatia51ade1295cd5
diff --git a/space/components/editor/lite-text-editor.tsx b/space/components/editor/lite-text-editor.tsx
index 677a342571..b911ebecb1 100644
--- a/space/components/editor/lite-text-editor.tsx
+++ b/space/components/editor/lite-text-editor.tsx
@@ -34,10 +34,9 @@ export const LiteTextEditor = React.forwardRef<EditorRefApi, LiteTextEditorWrapp
return !!ref && typeof ref === "object" && "current" in ref;
}
const isEmpty =
- props.initialValue === "" ||
props.initialValue?.trim() === "" ||
props.initialValue === "<p></p>" ||
- isEmptyHtmlString(props.initialValue ?? "");
+ (isEmptyHtmlString(props.initialValue ?? "") && !props.initialValue?.includes("mention-component"));
return (
<div className="border border-custom-border-200 rounded p-3 space-y-3">
diff --git a/web/components/editor/lite-text-editor/lite-text-editor.tsx b/web/components/editor/lite-text-editor/lite-text-editor.tsx
index 1be78a54e2..e99c2682e5 100644
--- a/web/components/editor/lite-text-editor/lite-text-editor.tsx
+++ b/web/components/editor/lite-text-editor/lite-text-editor.tsx
@@ -59,10 +59,9 @@ export const LiteTextEditor = React.forwardRef<EditorRefApi, LiteTextEditorWrapp
});
const isEmpty =
- props.initialValue === "" ||
props.initialValue?.trim() === "" ||
props.initialValue === "<p></p>" ||
- isEmptyHtmlString(props.initialValue ?? "");
+ (isEmptyHtmlString(props.initialValue ?? "") && !props.initialValue?.includes("mention-component"));
function isMutableRefObject<T>(ref: React.ForwardedRef<T>): ref is React.MutableRefObject<T | null> {
return !!ref && typeof ref === "object" && "current" in ref;