yjs/y-quill

Jumping cursor

volser opened this issue · 4 comments

If type text at the end of the line and there is a next line, the remote cursor is jumping to the next line.

how it looks:
https://www.loom.com/share/c4a6206629dc49c6bc45bef548e2f9c3

I'm not sure if we can fix that - seems to be an issue with the quill-cursors package.

Closing, but let me know if you have an idea on how to fix this.

@dmonad it does not looks like quill-cursors package bug

yjs calls this line twice successively one by one with different index
https://github.com/yjs/y-quill/blob/master/src/y-quill.js#L44

@dmonad it calls move cursor 3 times on type 1 symbol.
So how issue could be in quill-cursors lib?

image

only last update is correct. It sends an Awareness update before content update is applied.

Cursor updates:

  1. Awareness update (this one is wrong and cursor jumps here)
  2. Content update (cursor already in wrong position)
  3. Awareness update (this update fixes position)

image

@dmonad do you know Quill's editor-change emits 2 different events (text-change and selection-change).
So if you type symbol it emits 2 events and first is selection-change and only then text-change.
Can it be root of the issue?