diff --git a/components/email/ComposeEmail.tsx b/components/email/ComposeEmail.tsx index 41aaf28e..0f6a765b 100644 --- a/components/email/ComposeEmail.tsx +++ b/components/email/ComposeEmail.tsx @@ -355,9 +355,7 @@ export default function ComposeEmail(props: ComposeEmailProps) { onChange={(html) => { // Store the content setEmailContent(html); - - // But don't update direction on every keystroke - // The RichTextEditor will handle direction changes internally + // Direction will be handled automatically by the RichTextEditor based on content }} className="min-h-[320px] border rounded-md bg-white text-gray-800 flex-1" placeholder="Write your message here..." diff --git a/components/ui/rich-text-editor.tsx b/components/ui/rich-text-editor.tsx index 99cf6186..bfbb45dc 100644 --- a/components/ui/rich-text-editor.tsx +++ b/components/ui/rich-text-editor.tsx @@ -93,30 +93,8 @@ const RichTextEditor = forwardRef(({ } }; - // Toggle direction manually - const toggleDirection = () => { - const newDirection = direction === 'ltr' ? 'rtl' : 'ltr'; - setDirection(newDirection); - if (internalEditorRef.current) { - internalEditorRef.current.setAttribute('dir', newDirection); - } - }; - return (
- {!readOnly && ( -
- -
- )} -
(({ pointer-events: none; } + /* RTL text direction is automatically handled via dir attribute */ .rich-text-editor[dir="rtl"] { text-align: right; } @@ -158,6 +137,7 @@ const RichTextEditor = forwardRef(({ color: #666; } + /* Handle RTL blockquotes properly */ .rich-text-editor[dir="rtl"] blockquote { padding-left: 0; padding-right: 15px;