fix: comment text editor user mention validation addded (#4250)

This commit is contained in:
Anmol Singh Bhatia 2024-04-23 13:00:58 +05:30 committed by GitHub
parent ac3def2929
commit 51ade1295c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View File

@ -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">

View File

@ -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;