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

Pass onFirstRender option to ySyncPlugin #4530

Conversation

furkan3ayraktar
Copy link
Contributor

@furkan3ayraktar furkan3ayraktar commented Oct 12, 2023

Please describe your changes

There is an option called onFirstRender in the CollaborationOptions type; however, it is not used anywhere. This commit passes the option to the Yjs' sync plugin.

We use this callback together with the HocuspocusProvider to understand when the content is synced and ready on the editor for the first time. Then, we can safely set the cursor to the beginning of the text editor.

How did you accomplish your changes

Just used the existing option and correctly passed it to the ySyncPlugin function that creates the plugin.

How can we verify your changes

You can pass onFirstRender option to the Collaboration extension and see it gets called when the plugin first renders.

Checklist

  • [] The changes are not breaking the editor
  • [] Added tests where possible
  • [] Followed the guidelines
  • [] Fixed linting issues

here is an option called `onFirstRender` in the `CollaborationOptions` type; however, it is not used anywhere. This commit passes the option to the Yjs' sync plugin.
@netlify
Copy link

netlify bot commented Oct 12, 2023

Deploy Preview for tiptap-embed ready!

Name Link
🔨 Latest commit 0c4bff5
🔍 Latest deploy log https://app.netlify.com/sites/tiptap-embed/deploys/6527fc9da9eedf0008594b7e
😎 Deploy Preview https://deploy-preview-4530--tiptap-embed.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@svenadlung
Copy link
Contributor

LGTM, thx @furkan3ayraktar

@janthurau janthurau merged commit 58c78d7 into ueberdosis:develop Nov 17, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants