tiptap-solid icon indicating copy to clipboard operation
tiptap-solid copied to clipboard

`BubbleMenu` and collaboration features don't play nice together

Open odnamrataizem opened this issue 1 year ago • 3 comments

I reckon I'm still a young padawan at solid-js (slightly better at prosemirror and tiptap), but the editor's performance is massively reduced when configuring it as such:

import Collaboration from '@tiptap/extension-collaboration';
import StarterKit from '@tiptap/starter-kit';
import { Show } from 'solid-js';
import { BubbleMenu, createEditor, EditorContent } from 'tiptap-solid';
import * as Y from 'yjs';

const document = new Y.Doc();

export function Editor() {
  const editor = createEditor({
    extensions: [
      StarterKit.configure({ history: false }),
      Collaboration.configure({ document }),
    ],
  });

  return (
    <Show when={editor()}>
      <BubbleMenu editor={editor()} />
      <EditorContent editor={editor()} />
    </Show>
  );
}

Removing either @tiptap/extension-collaboration or BubbleMenu makes it happy again.

I'm using @solidjs/start v1.0.5 if it helps, but I didn't test this issue outside it.

odnamrataizem avatar Jul 24 '24 23:07 odnamrataizem

Seems like I made some mistakes with the initial implementation of the BubbleMenu The effect listener that was registering/unregistering the plugin would do that every single time the editor state changes, which is a lot

Just released v1.0.4 that should fix this hopefully, let me know

andi23rosca avatar Jul 25 '24 11:07 andi23rosca

Hmm, I ended up forgetting to mention that FloatingMenu has this problem as well...

That said, BubbleMenu is indeed fixed. Thanks!

odnamrataizem avatar Jul 25 '24 16:07 odnamrataizem

Yeah floating menu has exactly the same issue, thanks, will also fix that one soon

andi23rosca avatar Jul 25 '24 20:07 andi23rosca