ianstormtaylor / slate

A completely customizable framework for building rich text editors. (Currently in beta.)
http://slatejs.org
MIT License
29.97k stars 3.25k forks source link

[Japanese] Cannot Type Text in Japanese if text selected as the 1st Entry #4353

Open pampul opened 3 years ago

pampul commented 3 years ago

Description Dear all, This is a problem that occurs to all Japanese Users. There's a simple way to reproduce it:

We also reproduce the issue on our own product that it using slatejs when we try to automatically focus the editor: when Japanese characters are inputted, it fails after the first one. We had to remove the "auto-focus" on the editor to avoid such issue.

Recording Slate Examples

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

Steps To reproduce the behavior:

  1. Type any text in the editor (English or Japanese characters)
  2. Select all text (cmd+a)
  3. Do not erase the text: start typing Japanese characters directly ("tesuto" for example)
  4. You get stuck after the first character

Expectation Don't get stuck when you are typing Japanese characters after the first char :D

Environment

pampul commented 3 years ago

Note: I believe it might be a duplicate of: https://github.com/ianstormtaylor/slate/issues/4316 (but I tried to add as much information as I can, since the other issue linked is not very well understandable :D ) But it's still not fixed yet (tested on 0.65.2)

hueyhe commented 3 years ago

I've submitted a pull request #4352 to fix an issue regarding to the placeholder. It seems that this issue is also fixed. Could you try to reproduce this issue on this branch to see if it's indeed fixed?

pampul commented 3 years ago

Hey @hueyhe , I'm not able to test it right away since I'm off, but pretty sure it is the root cause indeed ;)