slate-yjs icon indicating copy to clipboard operation
slate-yjs copied to clipboard

cursor jumping to line start when using IME

Open dizys opened this issue 3 years ago • 1 comments

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.

yjs-slate-with-ime

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)

dizys avatar Aug 12 '22 05:08 dizys

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 🤔

BitPhinix avatar Sep 24 '22 18:09 BitPhinix