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

How to load another document into tiptap when using the Collaboration plugin? #691

Closed
brechtm opened this issue May 7, 2020 · 2 comments

Comments

@brechtm
Copy link

brechtm commented May 7, 2020

From #491 (comment) I learned how to load another document into the editor. However, I'm using the Collaboration plugin, and I need to also set the version of the document at that point. How can this be done?

@brechtm
Copy link
Author

brechtm commented May 7, 2020

Is it sufficient to overwrite .options.version on the Collaboration instance?

@brechtm
Copy link
Author

brechtm commented May 11, 2020

The following ugly hack seems to work 🤞 :

editor.options.content = doc
collaboration.options.version = version      # tiptap-extensions.Collaboration instance
editor.extensions = editor.createExtensions()
editor.plugins = editor.createPlugins()
editor.view.updateState(editor.createState())

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