yjs / y-prosemirror

ProseMirror editor binding for Yjs
https://demos.yjs.dev/prosemirror/prosemirror.html
MIT License
328 stars 115 forks source link

Cursor not in right position when in empty line in a code block. #119

Open Saul-Mirone opened 2 years ago

Saul-Mirone commented 2 years ago

Please save me some time and use the following template. In 90% of all issues I can't reproduce the problem because I don't know what exactly you are doing, in which environment, or which y-* version is responsible. Just use the following template even if you think the problem is obvious.

Checklist

Describe the bug Now I have client A and client B.

  1. When I move both client A's cursor in a newline in a codeblock.
  2. Now I cannot move client B's cursor at that new line.
  3. Then I switch back to client A, I find the position of the cursor is not right and I cannot move it to that new line.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://github.com/Saul-Mirone/prosemirror-yjs-bug-reproduce
  2. Clone the repo
  3. Run pnpm install && pnpm dev
  4. See error

Expected behavior Cursor at right position.

Screenshots If applicable, add screenshots to help explain your problem.

https://user-images.githubusercontent.com/10047788/171437451-b1e58677-e967-4555-bb30-71d649bd982a.mov

Environment Information