Skip to content

Commit a7364f1

Browse files
Update editor content in real time (#1066)
1 parent 5252241 commit a7364f1

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/components/Editor/index.jsx

+1-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import React, { useImperativeHandle, useState, useRef } from "react";
33
import { useEditor, EditorContent } from "@tiptap/react";
44
import classnames from "classnames";
55
import { noop, slugify } from "neetocist";
6-
import { useFuncDebounce } from "neetocommons/react-utils";
76
import { Label } from "neetoui";
87
import { EditorView } from "prosemirror-view";
98

@@ -115,11 +114,6 @@ const Editor = (
115114
});
116115
useEditorWarnings({ initialValue });
117116

118-
const handleChange = useFuncDebounce(
119-
({ editor }) => onChange(editor.getHTML()),
120-
100
121-
);
122-
123117
const editorClasses = classnames("neeto-editor", {
124118
"slash-active": isSlashCommandsActive && !isPlaceholderActive,
125119
"fixed-menu-active border": isFixedMenuActive,
@@ -155,7 +149,7 @@ const Editor = (
155149
},
156150
parseOptions: { preserveWhitespace: true },
157151
onCreate: ({ editor }) => !autoFocus && setInitialPosition(editor),
158-
onUpdate: handleChange,
152+
onUpdate: ({ editor }) => onChange(editor.getHTML()),
159153
onFocus,
160154
onBlur,
161155
});

0 commit comments

Comments
 (0)