Move editor content change callback

This commit is contained in:
Silvano Cerza 2025-02-20 18:09:21 +01:00
parent 165f2d277d
commit b5ebe4a638

View file

@ -55,10 +55,10 @@ const EditorPane: React.FC<EditorPaneProps> = (props) => {
width={"100%"} width={"100%"}
basicSetup={false} basicSetup={false}
extensions={extensions} extensions={extensions}
onChange={(value: string) => {
onContentChange(value);
}}
onUpdate={(viewUpdate: ViewUpdate) => { onUpdate={(viewUpdate: ViewUpdate) => {
if (viewUpdate.docChanged) {
onContentChange(viewUpdate.state.doc.toString());
}
// We want to know when it updates in case the line height changes // We want to know when it updates in case the line height changes
onEditorUpdate?.(viewUpdate.view); onEditorUpdate?.(viewUpdate.view);
}} }}