Helium314 / HeliBoard

Customizable and privacy-conscious open-source keyboard
Apache License 2.0
2.28k stars 86 forks source link

Duplicated words in some apps #426

Open cyrneko opened 8 months ago

cyrneko commented 8 months ago

Does it happen in OpenBoard, or is it exclusive to this modified version?

This bug goes all the way upstream to AOSP Keyboard, but Google obviously won't look into this and official OpenBoard seems quite dead.

Describe the bug

In some apps, words get duplicated (potentially by autocorrect) when typing normally. One such app is Element X, where upon editing a message or replying to a message whilst the text box is already focused, you'll run into issues with the words you're typing being duplicated.

To Reproduce

Expected behavior

Typing works normally, without any splitting or duplication

Screenshots

App version

helium314/OpenBoard 17.2 as per the GitHub release

Device (please complete the following information):

Additional context

This may be related to #356

MXC48 commented 8 months ago

Yes I also have in Instagram web

cyrneko commented 7 months ago

Yes I also have in Instagram web

With Firefox (or a fork) or Chromium (or a fork)?

adarsh1001 commented 7 months ago

Have noticed this issue in a few text fields on some websites, notably the chat field of Instagram web on the Brave browser. Happens with some websites on Firefox as well. Type any word, press space, press backspace and again press space and everything gets duplicated 😄 Using the latest app version.

Not reproducible with FlorisBoard so definitely not a website issue.

https://github.com/Helium314/openboard/assets/8820038/18553146-68aa-4aa5-b13a-b2245a2d3820

cc: @Helium314

Helium314 commented 7 months ago

Could be the same as #225. Does it work if you disable always show suggestions?

adarsh1001 commented 7 months ago

Always show suggestions is already disabled. Disabling Show correction suggestions fixes the issue.

adarsh1001 commented 7 months ago

Just noticed that in some cases, just pressing the backspace also triggers duplication.

adarsh1001 commented 7 months ago

@Helium314 I've found a reproducible case that can be replicated in any text field. May help in debugging:

  1. Open the keyboard in any text field.
  2. Write any word like "hello" followed by a space.
  3. Write an emoji name and select it from suggestions.
  4. Hold the backspace key.
  5. The word duplicates before getting deleted.
  6. Doing this one character at a time works fine.

https://github.com/Helium314/HeliBoard/assets/8820038/84e2a172-d11e-4bf6-acb8-bf494b76a0bf

Helium314 commented 7 months ago

That should really help a lot, thanks!

Helium314 commented 7 months ago

Hold the backspace key

Alternatively you can press the backspace key in quick succession. When you're too slow, everything works just as expected.

Looks like it depends on whether the second delete happens before or after performUpdateSuggestionStripSync is called. But I still have no idea what actually creates the duplicate word (or word part).

adarsh1001 commented 7 months ago

You're right, happens on quick successive backspaces as well.

ihatemakinganaccount commented 7 months ago

This is a known issue with the AOSP keyboard (and its forks) and WebKit apps. Would be really nice to find a solution and possibly push it even all the way up to AOSP.

But I'd bet there's someone who has a fix or PR for it and it just hasn't been merged, because the big G wants to push GBoard instead.

cyrneko commented 7 months ago

This is a known issue with the AOSP keyboard (and its forks) and WebKit apps. Would be really nice to find a solution and possibly push it even all the way up to AOSP.

But I'd bet there's someone who has a fix or PR for it and it just hasn't been merged, because the big G wants to push GBoard instead.

considering how this issue doesn't happen with GBoard, and how GBoard just forked off of AOSP Keyboard at some point...seems plausible

Helium314 commented 3 months ago

This might be fixed or at least improved in 2.0-beta2.