From 536ff35b343f6afdc8f38a7ffc3f677d93bc5c62 Mon Sep 17 00:00:00 2001 From: alma Date: Mon, 21 Apr 2025 18:44:02 +0200 Subject: [PATCH] mail page fix --- components/ComposeEmail.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/components/ComposeEmail.tsx b/components/ComposeEmail.tsx index 421aa880..235c16cf 100644 --- a/components/ComposeEmail.tsx +++ b/components/ComposeEmail.tsx @@ -54,13 +54,7 @@ export default function ComposeEmail({ // Update the contentEditable div when composeBody changes useEffect(() => { if (composeBodyRef.current && composeBody) { - // Clear existing content - composeBodyRef.current.innerHTML = ''; - // Create a temporary div to parse the HTML - const tempDiv = document.createElement('div'); - tempDiv.innerHTML = composeBody; - // Append the parsed content - composeBodyRef.current.appendChild(tempDiv); + composeBodyRef.current.innerHTML = composeBody; } }, [composeBody]); @@ -232,6 +226,7 @@ export default function ComposeEmail({ fontSize: 'inherit', lineHeight: 'inherit', }} + dangerouslySetInnerHTML={{ __html: composeBody }} onInput={handleInput} />