slate icon indicating copy to clipboard operation
slate copied to clipboard

Input Chinese character when selection is expanded will cause error

Open jiazheng opened this issue 2 years ago • 0 comments

Description Chinese input cause DOM structure broken rendered by slate

Recording recording

Sandbox Slate demo: https://www.slatejs.org/examples/richtext

Steps To reproduce the behavior: Install Baidu Chinese Input on windows

  1. Go to 'https://shurufa.baidu.com'
  2. download Chinese input and install on windows

Error produced on slate demo

  1. Go to 'https://www.slatejs.org/examples/richtext'
  2. Input two paragraphs at anywhere
  3. Switch to Baidu Chinese input installed previously
  4. Select all texts in first paragraph and input a character, say "d"
  5. Press "Enter" to cancel Chinese input
  6. The second line of texts is merged with letter "d" and if you check the dom structure you'll find it broken already
  7. Inputing any Chinese character will cause error which can be seen in console

Expectation When press "d" the second line of texts shouldn't be merged with the letter "d" and all input afterwards should not cause any errors. I perform the same steps on Draftjs, Quilljs and ProseMirror, they all perform as expected.

Environment

  • Slate Version: 0.82.0
  • Operating System: windows 10
  • Browser: Chrome

jiazheng avatar Aug 17 '22 04:08 jiazheng