From 60fc0281b4bed2e7b8605c65dabdc59583810665 Mon Sep 17 00:00:00 2001 From: Jonas Date: Mon, 6 Jul 2026 18:26:16 +0200 Subject: [PATCH 1/3] fix(createEditor): remove null-ref from component props This syntax seems to be supported by Vue2 but no longer by Vue3. It's redundant anyway as the used components CollaborativeEditorApp und MarkdownContentEditorApp already have `ref="editor-container"`. Fixes "[Vue warn]: Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function." Signed-off-by: Jonas --- src/createEditor.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/createEditor.ts b/src/createEditor.ts index dd1b44a4818..0ff34f18a7e 100644 --- a/src/createEditor.ts +++ b/src/createEditor.ts @@ -116,7 +116,6 @@ export async function createCollaborativeEditor(options: CollaborativeEditorOpti const app = createApp( CollaborativeEditorApp, { - ref: 'editor-container', ...data, active: true, fileId: options.fileId, @@ -146,7 +145,6 @@ export async function createMarkdownContentEditor(options: MarkdownContentEditor const app = createApp( MarkdownContentEditorApp, { - ref: 'editor-container', ...data, fileId: options.fileId, readonlyBarComponent: options.readonlyBar?.component, From 5f84a2bab9f176b7870a45f06bf119aa6e02784a Mon Sep 17 00:00:00 2001 From: Jonas Date: Mon, 6 Jul 2026 18:32:03 +0200 Subject: [PATCH 2/3] fix(useVisibility): cache observed element instead of requerying on unmount The editor might already be destroyed on unmount. Fixes "[tiptap error]: The editor view is not available. Cannot access view['dom']. The editor may not be mounted yet." Signed-off-by: Jonas --- src/composables/useVisibility.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/composables/useVisibility.ts b/src/composables/useVisibility.ts index a748ddc4bae..2ab970f2f67 100644 --- a/src/composables/useVisibility.ts +++ b/src/composables/useVisibility.ts @@ -68,12 +68,13 @@ export function useVisibility(id: string) { const { editor } = useEditor() const intersectionObserver = inject(intersectionObserverKey)! const visibleIds = inject(visibleIdsKey)! + let observedEl: Element | null = null onMounted(() => { nextTick(() => { - const el = editor.view.dom.querySelector(`#${id}`) - if (el) { - intersectionObserver.observe(el) + observedEl = editor.view.dom.querySelector(`#${id}`) + if (observedEl) { + intersectionObserver.observe(observedEl) } else { logger.warn(`Could not find element with id ${id}`) } @@ -83,9 +84,9 @@ export function useVisibility(id: string) { onUnmounted(() => { visibleIds.value.delete(id) visibleIds.value = new Set(visibleIds.value) // trigger reactivity - const el = editor.view.dom.querySelector(`#${id}`) - if (el) { - intersectionObserver.unobserve(el) + if (observedEl) { + intersectionObserver.unobserve(observedEl) + observedEl = null } }) const visible = computed(() => visibleIds.value.has(id)) From e301ccf94c0db433adecbddfe38c88858e3a0b95 Mon Sep 17 00:00:00 2001 From: Jonas Date: Mon, 6 Jul 2026 18:54:46 +0200 Subject: [PATCH 3/3] fix(createEditor): pass noLazyImages prop to editor components Signed-off-by: Jonas --- src/createEditor.ts | 4 ++++ src/views/CollaborativeEditorApp.vue | 3 +++ src/views/MarkdownContentEditorApp.vue | 3 +++ 3 files changed, 10 insertions(+) diff --git a/src/createEditor.ts b/src/createEditor.ts index 0ff34f18a7e..31280673c05 100644 --- a/src/createEditor.ts +++ b/src/createEditor.ts @@ -36,6 +36,7 @@ interface CollaborativeEditorOptions { content?: string readOnly?: boolean autofocus?: boolean + noLazyImages?: boolean readonlyBar?: ReadonlyBar menubarLinkCustomAction?: () => void onCreate?: ({ markdown }: { markdown: string }) => void @@ -63,6 +64,7 @@ interface MarkdownContentEditorOptions { content?: string readOnly?: boolean autofocus?: boolean + noLazyImages?: boolean readonlyBar?: ReadonlyBar menubarLinkCustomAction?: () => void onCreate?: ({ markdown }: { markdown: string }) => void @@ -121,6 +123,7 @@ export async function createCollaborativeEditor(options: CollaborativeEditorOpti fileId: options.fileId, mime: 'text/markdown', autofocus: options.autofocus ?? true, + noLazyImages: options.noLazyImages ?? false, readonlyBarComponent: options.readonlyBar?.component, relativePath: options.filePath, shareToken: options.shareToken, @@ -147,6 +150,7 @@ export async function createMarkdownContentEditor(options: MarkdownContentEditor { ...data, fileId: options.fileId, + noLazyImages: options.noLazyImages ?? false, readonlyBarComponent: options.readonlyBar?.component, relativePath: options.filePath, shareToken: options.shareToken, diff --git a/src/views/CollaborativeEditorApp.vue b/src/views/CollaborativeEditorApp.vue index 91a5e29bebc..8049e35774d 100644 --- a/src/views/CollaborativeEditorApp.vue +++ b/src/views/CollaborativeEditorApp.vue @@ -7,6 +7,7 @@