mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-12 01:39:47 +02:00
Fix CRITIQUE: Écriture fluide dans les notes réparée
This commit is contained in:
2 files changed
+10
-5
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user