Przeglądaj źródła

fix(admin-ui): Fix defaultValue on React RichTextEditor

Relates to #2884
Michael Bromley 1 rok temu
rodzic
commit
051d56fe0c

+ 3 - 0
packages/admin-ui/src/lib/react/src/react-components/RichTextEditor.tsx

@@ -85,6 +85,9 @@ export const RichTextEditor = forwardRef((props: RichTextEditorType, ref: Forwar
         if (props.onMount && editor) {
             props.onMount(editor);
         }
+        if (typeof props.defaultValue === 'string') {
+            editor.update(props.defaultValue);
+        }
     }, []);
     return (
         <>