courrier clean 2$

This commit is contained in:
alma 2025-04-26 21:28:34 +02:00
parent 88020ccfe5
commit e95f078bbc

View File

@ -188,13 +188,8 @@ export default function ComposeEmail(props: ComposeEmailAllProps) {
// Focus editor after initializing content
setTimeout(() => {
// For new messages, focus the textarea
if (!type || type === 'new') {
const textarea = document.querySelector('textarea');
textarea?.focus();
}
// For replies/forwards, focus the contentEditable div
else if (['reply', 'reply-all', 'forward'].includes(type) && editorRef.current) {
if (editorRef.current && type !== 'new') {
// For replies/forwards, focus contentEditable
editorRef.current.focus();
try {
@ -214,6 +209,10 @@ export default function ComposeEmail(props: ComposeEmailAllProps) {
} catch (e) {
console.error('Error positioning cursor:', e);
}
} else {
// For new emails, focus the textarea
const textarea = document.querySelector('textarea');
textarea?.focus();
}
}, 100);
} catch (error) {