lborgman / easy-cap-ed

For the captions editor EasyCapEd
0 stars 0 forks source link

Enter does not finish editing a word on a mobile #134

Closed lborgman closed 6 years ago

lborgman commented 6 years ago

Expected Behavior

Finish editing the word.

Actual Behavior

Inserts a new line.

lborgman commented 6 years ago

This looks a bit complicated at the moment. Keyboard Event Viewer grabs event.key for Enter in the "keydown" event, but I not see it in "contenteditable" fields.

However it seems possible to grab it from the "beforeinput" event at least in Gboard, but I do not know about other virtual keyboards on Android.

In desktop Chrome the "beforeinput" event.inputType has these values that are useful:

But... they are not the same on Gboard in mobile Chrome. "Enter" get the value insertCompositionText there - like normal characters. Sometimes. It is just buggy and unreliable.

However perhaps the event "beforeinput" can be used. It is buggy too, but so far only for Enter the event.data seems to be "editable". (As long as you do not type these characters, the event.data field is not emptied correctly...)

So there is a lot of external bugs here.

lborgman commented 6 years ago

I have filed the issue with Google. No one is looking at it yet, just the first line I believe. This person was at least friendly and I appreciate that. However I do not think they will fix it now (even though I pointed to possible security problems) since the standards are in a flux.

https://bugs.chromium.org/p/chromium/issues/detail?id=809107

So I am looking for an easy work around. (I know how to do a work around, but I want an easy one.)

lborgman commented 6 years ago

I have given up adding a work around to EasyCapEd. It is possible, but not necessary. If Google does not want to fix Gboard then SwiftKey can be used.

To be clear: The bug is in Gboard.

lborgman commented 6 years ago

I have added a message to the user with explanations of how to avoid the bug. Closing this. This is a problem for Google.