diff --git a/.yarn/versions/a8b09489.yml b/.yarn/versions/a8b09489.yml new file mode 100644 index 0000000..206c26a --- /dev/null +++ b/.yarn/versions/a8b09489.yml @@ -0,0 +1,2 @@ +releases: + "@handlewithcare/react-prosemirror": patch diff --git a/src/hooks/useEditor.ts b/src/hooks/useEditor.ts index a962a68..a9b4e4c 100644 --- a/src/hooks/useEditor.ts +++ b/src/hooks/useEditor.ts @@ -71,7 +71,8 @@ export function useEditor( const dispatchTransaction = useCallback( function dispatchTransaction(this: EditorView, tr: Transaction) { - if (flushSyncRef.current) { + const async = tr.getMeta("async"); + if (flushSyncRef.current && !async) { flushSync(() => { if (!options.state) { setState((s) => s.apply(tr));