option + arrow key in chinese won't jump by word
Description press option + arrow in chinese text, the position of cursor is wrong compared to pure contenteditable div
Recording
it can be reproduce in https://codesandbox.io/s/slate-reproductions-forked-uw6ud
Sandbox A link to a sandbox where the error can be reproduced. (You can start from the base sandbox here: https://codesandbox.io/s/slate-reproductions-c7gyg or refer to the Slate website too.)
https://codesandbox.io/s/slate-reproductions-forked-uw6ud
Steps To reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expectation A clear and concise description of what you expected to happen. (Often it's helpful to test out the behavior of other editors like Google Docs, Medium, Notion, etc. to see how they handle the same issue.)
Environment
- Slate Version: current version all platform
Context i think the code
Hotkeys.isMoveWordBackward(nativeEvent) in editable.tsx
is not right for chinese text
Source: ianstormtaylor/slate