@@ -800,41 +800,27 @@ export class BlockNoteEditor<
800
800
return callback ( ) ;
801
801
}
802
802
803
- let result : T = undefined as T ;
804
-
805
803
try {
806
804
// Enter transaction mode, by setting a start state
807
805
this . transactionState = this . prosemirrorState ;
808
806
809
- // Capture all tiptap transactions (tiptapEditor.dispatch'd transactions)
810
- const tiptapTr = this . _tiptapEditor . captureTransaction ( ( ) => {
811
- // This is more of a safety mechanism, as we catch blocknote transactions separately
812
- result = callback ( ) ;
813
- } ) ;
807
+ // Capture all dispatch'd transactions
808
+ const result = callback ( ) ;
814
809
815
810
// Any transactions captured by the `dispatch` call will be stored in `this.activeTransaction`
816
- let activeTr = this . activeTransaction ;
817
-
818
- if ( tiptapTr && activeTr ) {
819
- // If we have both tiptap & blocknote transactions, there is not a clean way to merge them as you'd need to know the order of operations
820
- throw new Error (
821
- "Cannot mix tiptap transactions with BlockNote transactions"
822
- ) ;
823
- } else if ( tiptapTr ) {
824
- // If we only have tiptap caught transactions, we can just use that
825
- activeTr = tiptapTr ;
826
- }
811
+ const activeTr = this . activeTransaction ;
827
812
813
+ this . transactionState = null ;
828
814
if ( activeTr ) {
815
+ this . activeTransaction = null ;
829
816
// Dispatch the transaction if it was modified
830
- this . _tiptapEditor . dispatch ( activeTr ) ;
817
+ this . dispatch ( activeTr ) ;
831
818
}
819
+ return result ;
832
820
} finally {
833
821
this . activeTransaction = null ;
834
822
this . transactionState = null ;
835
823
}
836
-
837
- return result ;
838
824
}
839
825
840
826
/**
0 commit comments