facebook / lexical

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.
https://lexical.dev
MIT License
19.66k stars 1.67k forks source link

Bug: When typing with auto-correction on using Google Keyboard #5525

Open benedikus opened 9 months ago

benedikus commented 9 months ago

Lexical version: v0.12.6

Steps To Reproduce

  1. Open https://playground.lexical.dev/ with Android device
  2. Turn on auto correction google keyboard
  3. Type normally using google keyboard
  4. The bug seems appear on the first word each paragraph node (or when the text node is empty)

I try to reproduce using other virtual keyboard with these results:

  1. Using Android keyboard -> Can't auto-correct -> Bug doesn't appear
  2. Using Google keyboard -> Can auto-correct -> Bug appears
  3. Using iOS keyboard -> Can auto-correct -> Bug doesn't appear
  4. Using Google keyboard on iOS -> Can auto-correct -> Bug doesn't appear

I also tried typing using Google Input Tools extensions for Chrome:

  1. The backspace doesn't works
  2. Can't type the first character in an empty text node (but you can type normally if the text is not empty).

Link to code example:

I think the weird behavior occurred when the composition event was triggered.

The current behavior

https://github.com/facebook/lexical/assets/15336005/7225034e-5e78-4b9c-876f-07ba675be87c

The expected behavior

Can type with Auto-correction normally.

benedikus commented 7 months ago

Lexical version: v0.14.2

https://github.com/facebook/lexical/assets/15336005/3c83b2a5-bfc7-4e08-90aa-8e15efcd9687

I tried again for version 14.2, looks like it's working normally now.