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

Initialize document #16

Closed
amilich opened this issue Apr 12, 2020 · 3 comments
Closed

Initialize document #16

amilich opened this issue Apr 12, 2020 · 3 comments

Comments

@amilich
Copy link

amilich commented Apr 12, 2020

How can you set the initial contents of the Y.doc with some existing ProseMirror node view?

@dmonad
Copy link
Member

dmonad commented Apr 15, 2020

Hi @amilich,

y-prosemirror takes over the document content of the ProseMirror editor after it has been bound to it. The "initial" content, that you set when creating the ProseMirror editor must be ignored in order to converge content with other clients.

You can set the "initial" content after you created the editor. It should be empty. But please also have a look at this question in order to understand why it is not a good idea to work with "initial" content: yjs/yjs-demos#16

@amilich
Copy link
Author

amilich commented Apr 15, 2020 via email

@amilich amilich closed this as completed Apr 18, 2020
@andrey-skl
Copy link

Hello everyone and sorry for maybe dumb question. I've read your messages and yjs/yjs-demos#16 too, but still can't figure out what is the right way to do the following:

  1. We have a stored document, loaded from API
  2. User loads it to the prosemirror to edit
  3. Some other user connects to this to collaborate

What is the right way to initialize a yjs "room" with the content that already exists?

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

3 participants