From 51ade1295cd5b73760084f1727e9e410f7d4a6e7 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Tue, 23 Apr 2024 13:00:58 +0530 Subject: [PATCH] fix: comment text editor user mention validation addded (#4250) --- space/components/editor/lite-text-editor.tsx | 3 +-- web/components/editor/lite-text-editor/lite-text-editor.tsx | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/space/components/editor/lite-text-editor.tsx b/space/components/editor/lite-text-editor.tsx index 677a34257..b911ebecb 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

" || - isEmptyHtmlString(props.initialValue ?? ""); + (isEmptyHtmlString(props.initialValue ?? "") && !props.initialValue?.includes("mention-component")); return (
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 1be78a54e..e99c2682e 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

" || - isEmptyHtmlString(props.initialValue ?? ""); + (isEmptyHtmlString(props.initialValue ?? "") && !props.initialValue?.includes("mention-component")); function isMutableRefObject(ref: React.ForwardedRef): ref is React.MutableRefObject { return !!ref && typeof ref === "object" && "current" in ref;