Remove im ready message (#843)
This commit is contained in:
parent
e2e5f7f7a5
commit
439e5b249e
2 changed files with 4 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
import EditorJS, { OutputData } from "@editorjs/editorjs";
|
import EditorJS, { LogLevels, OutputData } from "@editorjs/editorjs";
|
||||||
import FormControl from "@material-ui/core/FormControl";
|
import FormControl from "@material-ui/core/FormControl";
|
||||||
import FormHelperText from "@material-ui/core/FormHelperText";
|
import FormHelperText from "@material-ui/core/FormHelperText";
|
||||||
import InputLabel from "@material-ui/core/InputLabel";
|
import InputLabel from "@material-ui/core/InputLabel";
|
||||||
|
@ -40,6 +40,7 @@ const RichTextEditor: React.FC<RichTextEditorProps> = ({
|
||||||
editor.current = new EditorJS({
|
editor.current = new EditorJS({
|
||||||
data,
|
data,
|
||||||
holder: editorContainer.current,
|
holder: editorContainer.current,
|
||||||
|
logLevel: "ERROR" as LogLevels,
|
||||||
onChange: async api => {
|
onChange: async api => {
|
||||||
const savedData = await api.saver.save();
|
const savedData = await api.saver.save();
|
||||||
onChange(savedData);
|
onChange(savedData);
|
||||||
|
@ -61,7 +62,6 @@ const RichTextEditor: React.FC<RichTextEditorProps> = ({
|
||||||
// Rerender editor only if changed from undefined to defined state
|
// Rerender editor only if changed from undefined to defined state
|
||||||
[data === undefined]
|
[data === undefined]
|
||||||
);
|
);
|
||||||
React.useEffect(() => editor.current?.destroy, []);
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (editor.current?.readOnly) {
|
if (editor.current?.readOnly) {
|
||||||
editor.current.readOnly.toggle(disabled);
|
editor.current.readOnly.toggle(disabled);
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import EditorJS, {
|
import EditorJS, {
|
||||||
|
LogLevels,
|
||||||
OutputData,
|
OutputData,
|
||||||
ToolConstructable,
|
ToolConstructable,
|
||||||
ToolSettings
|
ToolSettings
|
||||||
|
@ -54,6 +55,7 @@ const RichTextEditorContent: React.FC<RichTextEditorContentProps> = ({
|
||||||
editor.current = new EditorJS({
|
editor.current = new EditorJS({
|
||||||
data,
|
data,
|
||||||
holder: editorContainer.current,
|
holder: editorContainer.current,
|
||||||
|
logLevel: "ERROR" as LogLevels,
|
||||||
onReady,
|
onReady,
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
tools
|
tools
|
||||||
|
@ -65,7 +67,6 @@ const RichTextEditorContent: React.FC<RichTextEditorContentProps> = ({
|
||||||
// Rerender editor only if changed from undefined to defined state
|
// Rerender editor only if changed from undefined to defined state
|
||||||
[data === undefined]
|
[data === undefined]
|
||||||
);
|
);
|
||||||
React.useEffect(() => editor.current?.destroy, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|
Loading…
Reference in a new issue