Fix CRITIQUE: Écriture fluide dans les notes réparée

This commit is contained in:
Claude committed 2025-11-12 09:37:00 +00:00
1 parent a36bb04c66
commit ece7232f0d
2 files changed
+10 -5

No files matched your search

+4 -2
View File
@@ -29,11 +29,13 @@ export function RichTextEditor({ content, onChange, placeholder }: RichTextEdito
const editorRef = useRef<HTMLDivElement>(null);
const [selectedFormat, setSelectedFormat] = useState<string[]>([]);
// Set initial content only once on mount
useEffect(() => {
if (editorRef.current && editorRef.current.innerHTML !== content) {
if (editorRef.current) {
editorRef.current.innerHTML = content;
}
}, [content]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []); // Empty deps - only run once on mount
const execCommand = (command: string, value?: string) => {
document.execCommand(command, false, value);