Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BubbleMenu and collaboration features don't play nice together #5

Open
odnamrataizem opened this issue Jul 24, 2024 · 3 comments
Open

Comments

@odnamrataizem
Copy link

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.

@andi23rosca
Copy link
Owner

andi23rosca commented Jul 25, 2024

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

@odnamrataizem
Copy link
Author

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

That said, BubbleMenu is indeed fixed. Thanks!

@andi23rosca
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants