I have set up a collab editor like in collab example on the website but with websockets. Its working fine.
I have now added the functionality where in all the users can see each others selections like in Google docs.
- Lets say two users are editing the same doc, user0 and user1.
- user0’s cursor is somewhere at the start of a line. And user1’s cursor is at the end of that line.
- Now, when user0 types a character, user0’s cursor jumps to the position of user1’s cursor. And then the characters are written at this new position.
You can see the sample here -> https://youtu.be/jF-jtEtnnjw
The strange thing is when I try to look into “selection” in EditorState of the editor in chrome DevTools, the selection there shows the position at end of the line (where it should have been). Which means somehow DOM position changed but prosemirror’s position remained correct.
Please let me know, if it seems like a bug or something I am doing wrong. The code I have is all integrated with my application code. So it is hard to separate it out. But let me know, and I will try to figure out something.
Thanks and, BTW awesome editor