File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -205,12 +205,15 @@ export class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockSchema> {
205
205
206
206
this . schema = newOptions . blockSchema ;
207
207
208
- const initialContent = newOptions . initialContent || [
209
- {
210
- type : "paragraph" ,
211
- id : UniqueID . options . generateID ( ) ,
212
- } ,
213
- ] ;
208
+ const initialContent =
209
+ newOptions . initialContent || options . collaboration
210
+ ? undefined
211
+ : [
212
+ {
213
+ type : "paragraph" ,
214
+ id : UniqueID . options . generateID ( ) ,
215
+ } ,
216
+ ] ;
214
217
215
218
const tiptapOptions : EditorOptions = {
216
219
...blockNoteTipTapOptions ,
@@ -220,6 +223,10 @@ export class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockSchema> {
220
223
this . ready = true ;
221
224
} ,
222
225
onBeforeCreate ( editor ) {
226
+ if ( ! initialContent ) {
227
+ // when using collaboration
228
+ return ;
229
+ }
223
230
// we have to set the initial content here, because now we can use the editor schema
224
231
// which has been created at this point
225
232
const schema = editor . editor . schema ;
You can’t perform that action at this time.
0 commit comments