File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,7 @@ export class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockSchema> {
149149 public readonly _tiptapEditor : TiptapEditor & { contentComponent : any } ;
150150 public blockCache = new WeakMap < Node , Block < BSchema > > ( ) ;
151151 public readonly schema : BSchema ;
152+ private ready = false ;
152153
153154 public get domElement ( ) {
154155 return this . _tiptapEditor . view . dom as HTMLDivElement ;
@@ -204,11 +205,24 @@ export class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockSchema> {
204205 newOptions . onEditorReady ?.( this ) ;
205206 newOptions . initialContent &&
206207 this . replaceBlocks ( this . topLevelBlocks , newOptions . initialContent ) ;
208+ this . ready = true ;
207209 } ,
208210 onUpdate : ( ) => {
211+ // This seems to be necessary due to a bug in TipTap:
212+ // https://github.com/ueberdosis/tiptap/issues/2583
213+ if ( ! this . ready ) {
214+ return ;
215+ }
216+
209217 newOptions . onEditorContentChange ?.( this ) ;
210218 } ,
211219 onSelectionUpdate : ( ) => {
220+ // This seems to be necessary due to a bug in TipTap:
221+ // https://github.com/ueberdosis/tiptap/issues/2583
222+ if ( ! this . ready ) {
223+ return ;
224+ }
225+
212226 newOptions . onTextCursorPositionChange ?.( this ) ;
213227 } ,
214228 editable : options . editable === undefined ? true : options . editable ,
You can’t perform that action at this time.
0 commit comments