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

[Bug]: Yjs document not updating when chaining commands #5792

Open
1 task done
daveychu opened this issue Oct 31, 2024 · 0 comments
Open
1 task done

[Bug]: Yjs document not updating when chaining commands #5792

daveychu opened this issue Oct 31, 2024 · 0 comments
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug

Comments

@daveychu
Copy link

daveychu commented Oct 31, 2024

Affected Packages

core, react, yjs

Version(s)

2.9.1, 18.3.1, 13.6.20

Bug Description

When chaining certain commands, the Yjs document does not get updated.

Reproduction:

  • Open the CodeSandbox link
  • Select "Hello world" -> Bubble menu opens
  • Select Superscript -> "yjs doc updated" in console
  • BUG: Select Subscript -> no update in console, but style does get applied visually
  • Select Subscript again -> "yjs doc updated" in console

Replacing

editor.chain().focus().unsetSubscript().toggleSuperscript().run();

with

editor.commands.unsetSubscript();
editor.chain().focus().toggleSuperscript().run();

gives the expected behavior

Browser Used

Chrome

Code Example URL

https://codesandbox.io/s/adoring-fermat-g68g75?file=/src/App.js

Expected Behavior

I expect the chained version to work equivalent to the unchained one.

Additional Context (Optional)

Since the update isn't detected on the Yjs document, it also doesn't get propagated to other clients/servers when using HocuspocusProvider for example.

Dependency Updates

  • Yes, I've updated all my dependencies.
@daveychu daveychu added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug labels Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug
Projects
None yet
Development

No branches or pull requests

1 participant