mail page fix design

This commit is contained in:
alma 2025-04-21 21:27:51 +02:00
parent 448f34e655
commit 6df9284be7

View File

@ -63,19 +63,16 @@ export default function ComposeEmail({
if (composeBodyRef.current) { if (composeBodyRef.current) {
const decodedContent = decodeComposeContent(composeBody); const decodedContent = decodeComposeContent(composeBody);
composeBodyRef.current.innerHTML = ` composeBodyRef.current.innerHTML = `
<div style="min-height: 20px;"></div> <div style="margin-bottom: 20px;"></div>
<div style="white-space: pre-wrap; word-wrap: break-word;"> ${decodedContent}`;
${decodedContent}
</div> // Place cursor at the beginning
`;
const range = document.createRange(); const range = document.createRange();
const sel = window.getSelection(); const sel = window.getSelection();
if (composeBodyRef.current.firstChild) { range.setStart(composeBodyRef.current, 0);
range.setStart(composeBodyRef.current.firstChild, 0); range.collapse(true);
range.collapse(true); sel?.removeAllRanges();
sel?.removeAllRanges(); sel?.addRange(range);
sel?.addRange(range);
}
} }
}, [composeBody]); }, [composeBody]);
@ -265,11 +262,7 @@ export default function ComposeEmail({
onInput={handleInput} 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" className="w-full h-full mt-1 bg-white border border-gray-300 rounded-md p-2 text-gray-900 overflow-y-auto"
style={{ style={{
minHeight: '200px', minHeight: '200px'
whiteSpace: 'pre-wrap',
wordWrap: 'break-word',
overflowWrap: 'break-word',
writingMode: 'horizontal-tb'
}} }}
/> />
</div> </div>