Skip to content

Commit fb98b5c

Browse files
authored
Merge pull request #9161 from nextcloud/backport/9160/stable35
[stable35] fix(collaboration): override addProseMirrorPlugins to prevent default caret user
2 parents f346d30 + 88f9b75 commit fb98b5c

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/extensions/CollaborationCaret.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import { t } from '@nextcloud/l10n'
77
import { CollaborationCaret as TiptapCollaborationCaret } from '@tiptap/extension-collaboration-caret'
8+
import { yCursorPlugin } from '@tiptap/y-tiptap'
89

910
export interface AwarenessUser {
1011
color: string
@@ -97,6 +98,16 @@ const CollaborationCaret = TiptapCollaborationCaret.extend({
9798
})
9899
}
99100
},
101+
102+
// Override to stop tiptap from setting its own default user
103+
addProseMirrorPlugins() {
104+
return [
105+
yCursorPlugin(this.options.provider.awareness, {
106+
cursorBuilder: this.options.render,
107+
selectionBuilder: this.options.selectionRender,
108+
}),
109+
]
110+
},
100111
})
101112

102113
export default CollaborationCaret

0 commit comments

Comments
 (0)