Skip to content

Commit e538c26

Browse files
committed
Merge branch 'main' into new-releases
2 parents 590c351 + c70fe6e commit e538c26

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

packages/core/src/BlockNoteEditor.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,15 @@ export class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockSchema> {
205205

206206
this.schema = newOptions.blockSchema;
207207

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+
];
214217

215218
const tiptapOptions: EditorOptions = {
216219
...blockNoteTipTapOptions,
@@ -220,6 +223,10 @@ export class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockSchema> {
220223
this.ready = true;
221224
},
222225
onBeforeCreate(editor) {
226+
if (!initialContent) {
227+
// when using collaboration
228+
return;
229+
}
223230
// we have to set the initial content here, because now we can use the editor schema
224231
// which has been created at this point
225232
const schema = editor.editor.schema;

0 commit comments

Comments
 (0)