diff --git a/src/lib/components/RichTextInput/ClientInput.svelte b/src/lib/components/RichTextInput/ClientInput.svelte index c36135b..e48767e 100644 --- a/src/lib/components/RichTextInput/ClientInput.svelte +++ b/src/lib/components/RichTextInput/ClientInput.svelte @@ -27,11 +27,11 @@ { mount: domEl }, { state, - dispatchTransaction: (tr) => { - const newState = state.apply(tr); + dispatchTransaction(tr) { + const newState = editorView.state.apply(tr); editorView.updateState(newState); - onDocChange?.(newState.doc); + onDocChange?.(newState.doc); isEmpty = newState.doc.textContent.length === 0; } }