mail page fix design

This commit is contained in:
alma 2025-04-21 20:10:02 +02:00
parent f05c4dac7f
commit 401a0c4426

View File

@ -54,7 +54,17 @@ export default function ComposeEmail({
useEffect(() => {
if (composeBodyRef.current) {
composeBodyRef.current.innerHTML = composeBody;
// Remove any 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 to the contentEditable div
while (tempDiv.firstChild) {
composeBodyRef.current.appendChild(tempDiv.firstChild);
}
}
}, [composeBody]);
@ -219,8 +229,12 @@ export default function ComposeEmail({
contentEditable
onInput={handleInput}
className="w-full h-full mt-1 bg-white border border-gray-300 rounded-md p-2 text-gray-900 overflow-y-auto prose max-w-none"
style={{ minHeight: '200px' }}
dangerouslySetInnerHTML={{ __html: composeBody }}
style={{
minHeight: '200px',
direction: 'ltr',
textAlign: 'left'
}}
dir="ltr"
/>
</div>
</div>