wordpress-mobile / AztecEditor-Android

A reusable native Android rich text editor component.
Mozilla Public License 2.0
675 stars 112 forks source link

After space is deleted when typing new characters on Samsung android 13 words are added. #1026

Closed matictina closed 7 months ago

matictina commented 1 year ago

After the update https://github.com/wordpress-mobile/AztecEditor-Android/pull/1024 new bug is introduced. If the user misspells some words for example the word "hav", and then adds the space character. After deleting the space character and adding for example character "e" to fix misspelling, the whole word "have" is added to the end of the existing word, so "hav" becomes "havhave".

Expected

Expected behaviour in this case would be for just one character to be added instead of the whole word. In this case if character "e" is added to "hav" it should show "have" instead of "havhave". Attached is the video of the bug.

Observed

https://user-images.githubusercontent.com/123743197/215427010-a289a559-1fa1-467c-8d2f-56c142080001.mp4

Reproduced

  1. Open demo app
  2. Type "hav" in Heading 1 section
  3. Type space
  4. Delete space
  5. Type "e"

Tested

Samsung S21 on 13

khaykov commented 1 year ago

Thanks for the report, @matictina ! I managed to reproduce the issue, and took a couple of hours to see if it's something that might be easy to fix, but unfortunately, no - it will require a bit more time. At least I was able to pinpoint the issue to getExtractedText method inside InputConenction that Samsung is using in a way they are not supposed to.

I'll have to get back to this issue at a later time, and hope that Samsung will fix it on their end, since other keyboards work ok.

If it's a critical issue for you, you add textVisiblePassword to the inputType of AztecText - this will disable disable autocorrect/autosuggestion, but will also fix the issue.