diff --git a/.cursor/rules/docs.mdc b/.cursor/rules/docs.mdc index 4b13faf..a3125d3 100644 --- a/.cursor/rules/docs.mdc +++ b/.cursor/rules/docs.mdc @@ -1,6 +1,5 @@ --- -description: Documentation rules -alwaysApply: false +alwaysApply: true --- When documenting this project, follow these rules: diff --git a/frontend/src/core/components/RichTextArea.tsx b/frontend/src/core/components/RichTextArea.tsx index 8fb44e0..c2854a6 100644 --- a/frontend/src/core/components/RichTextArea.tsx +++ b/frontend/src/core/components/RichTextArea.tsx @@ -10,6 +10,7 @@ interface RichTextAreaProps { className?: string; rows?: number; autoComplete?: string; + readOnly?: boolean; } export function RichTextArea({ @@ -21,6 +22,7 @@ export function RichTextArea({ className, rows = 1, autoComplete = "off", + readOnly = false }: RichTextAreaProps) { const textareaRef = useRef(null); const hiddenTextareaRef = useRef(null); @@ -183,10 +185,10 @@ export function RichTextArea({ value={text} placeholder={placeholder} rows={rows} - autoComplete={autoComplete} - onChange={handleChange} - onKeyDown={handleKeyDown} - /> + autoComplete={readOnly ? "off" : autoComplete} + onChange={readOnly ? undefined : handleChange} + onKeyDown={readOnly ? undefined : handleKeyDown} + readOnly={readOnly} />