@@ -578,6 +612,8 @@ function LegacyAdapter({
});
const replyContent = `
+
+
On ${date}, ${sender} wrote:
@@ -605,6 +641,8 @@ function LegacyAdapter({
});
const forwardContent = `
+
+
diff --git a/components/email/RichEmailEditor.tsx b/components/email/RichEmailEditor.tsx
index 8e47ac13..1e3d7d62 100644
--- a/components/email/RichEmailEditor.tsx
+++ b/components/email/RichEmailEditor.tsx
@@ -111,13 +111,37 @@ const RichEmailEditor: React.FC = ({
console.log('Using HTML fallback for tables');
quillRef.current.root.innerHTML = preservedContent;
}
+
+ // Ensure the cursor and scroll position is at the top of the editor
+ quillRef.current.setSelection(0, 0);
+
+ // Also scroll the container to the top
+ if (editorRef.current) {
+ editorRef.current.scrollTop = 0;
+
+ // Also find and scroll parent containers that might have scroll
+ const scrollContainer = editorRef.current.closest('.ql-container');
+ if (scrollContainer) {
+ scrollContainer.scrollTop = 0;
+ }
+
+ // One more check for nested scroll containers (like overflow divs)
+ const parentScrollContainer = editorRef.current.closest('.rich-email-editor-container');
+ if (parentScrollContainer) {
+ parentScrollContainer.scrollTop = 0;
+ }
+ }
}, 50);
+ } else {
+ // For simple content, just set the cursor at the top
+ quillRef.current.setSelection(0, 0);
}
} catch (err) {
console.error('Error setting initial content:', err);
// Fallback method if the above fails
quillRef.current.setText('');
quillRef.current.clipboard.dangerouslyPasteHTML(sanitizeHtml(initialContent));
+ quillRef.current.setSelection(0, 0);
}
}
@@ -282,6 +306,21 @@ const RichEmailEditor: React.FC = ({
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
font-size: 14px;
line-height: 1.5;
+ color: #333 !important;
+ }
+
+ /* Ensure all text is visible */
+ :global(.ql-editor p),
+ :global(.ql-editor div),
+ :global(.ql-editor span),
+ :global(.ql-editor li) {
+ color: #333 !important;
+ }
+
+ /* Ensure placeholder text is visible but distinct */
+ :global(.ql-editor.ql-blank::before) {
+ color: #aaa !important;
+ font-style: italic !important;
}
/* Force blockquote styling */