#4466·slate

option + arrow key in chinese won't jump by word

Author: helloyulifeCreated Aug 24, 2021Updated Apr 2, 2026
Labelsbug

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:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. 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