slate
slate copied to clipboard
Caret jump to wrong position after composition end.
Description MacOS + chrome 113, caret jump to the front of word after composition end. Which should stay after the word. This bug didn't show up in MacOS + Safari 16.5.
Recording http://recordit.co/mNllqsP6BD
Sandbox https://codesandbox.io/s/slate-caret-bug-forked-gvrzh4?file=/index.js
Steps To reproduce the behavior:
Go to https://codesandbox.io/s/slate-caret-bug-forked-gvrzh4?file=/index.js Switch to any chinese IME. Focus the input area. Type a word, like 'wokankan', select '我看看' from IME, then you will see the bug. The bug looks like: [caret]我看看, and it should be: 我看看[caret]
Environment
Slate Version: "slate": "0.94.1", "slate-react": "0.96.0" Operating System: MacOS 13.4 Browser: Chrome 113.0.5672.126
I found the bug is related to this PR: https://github.com/ianstormtaylor/slate/pull/5437, remove !IS_WEBKIT &&
at line 1117 in packages/slate-react/src/components/editable.tsx
can fix this. But I don't know if this would bring any side effect.