ianstormtaylor / slate

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

double the input content when in chrome using Microsoft ime lost focus #5653

Open tsxuehu opened 1 month ago

tsxuehu commented 1 month ago

Description on windows,in chrome, using microsoft ime,when lost focus,the input content will be doubled

Recording

https://github.com/ianstormtaylor/slate/assets/41042044/576867c9-2179-4c69-8a06-b24670391259

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

Steps

  1. on windows,using chrome open: https://www.slatejs.org/examples/richtext
  2. using Microsoft ime type chars
  3. click page any where
  4. see the content doubled

Expectation the input content not doubled

Environment

Context when lost focus while composition,chrome will produce two beforeinput event after compositionend event。

  1. beforeinput deleteContentBackward
  2. beforeinput insertText the compositionend and beforeinput(insertText) event make the content doubled
tsxuehu commented 1 month ago

my project current solution: