keymanapp / keyman

Keyman cross platform input methods system running on Android, iOS, Linux, macOS, Windows and mobile and desktop web
https://keyman.com/
Other
403 stars 112 forks source link

bug(mac): excess backspace when deleting composed character in Google Docs #10246

Open sgschantz opened 11 months ago

sgschantz commented 11 months ago

Describe the bug

When typing in Google Docs with the Kenya (BTL) keyboard, backspacing over a composed characters causes the unaccented character to replace the accented/composed character AND the previous character.

Reproduce the bug

Type:b^u Output: bû Type: backspace Output: u

Expected behavior

Type:b^u Output: bû Type: backspace Output: bu

Related issues

No response

Keyman apps

Keyman version

17

Operating system

No response

Device

No response

Target application

Google Docs running in Google Chrome

Browser

No response

Keyboard name

Kenya (BTL)

Keyboard version

No response

Language name

No response

Additional context

No response

sgschantz commented 11 months ago

Also seeing this with the Atom editor

sgschantz commented 9 months ago

There appears to be a fix for this by avoiding queing a backspace event when the event that triggers the generated backspace happens to also be a backspace, but only for certain non-compliant apps: Google Docs running on Chrome and Atom Editor. Suppressing the backspace event for Texstudio in this scenario will result in no backspace at all instead of an excess backspace.

So the only solution appears to require creating a separate list of non-compliant apps just for this scenario. There is definitely no way to detect this behavior while it is happening.

mcdurdin commented 9 months ago

Given Atom Editor is open source (albeit effectively dead!), we should be able to trace the entire sequence of events there. (Does the same issue arise with VSCode?)

It'd be interesting to do the same under Chrome / Chromium and Google Docs -- but Google Docs is not open of course.

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/state_machines/backspace_state_machine.cc?q=backspace&ss=chromium is interesting reading.

sgschantz commented 7 months ago

Moving to 18 because there is little time remaiming in 17, and this is limited to some legacy apps.