slate-yjs
slate-yjs copied to clipboard
cursor jumping to line start when using IME
What is an IME?
IMEs are used to type non-latin languages (such as many Asian languages) with latin (QWERTY) keyboard.
Current behavior
While UserA is in the middle of typing with IME, UserB insert characters at the same line. The cursor of UserA will jump to line start when it receives changes from UserB.

Expected behavior
Cursor of UserA should stay where UserA was trying to insert.
Environment
Reproduced on: demo site MacOS: 12.4 Chrome: 104.0.5112.81 (arm64)
It's more of a slate issue, tbh. The issue is that the remote change is causing the node to re-render, but slate doesn't update/re-set the user selection so it ends up at the start of the node. One solution would be to no apply remote changes while the user is composing 🤔