Page MenuHomePhabricator

VisualEditor Mobile: Chrome for mobile keyboard doesn't fire useful key events for backspace
Open, LowPublic8 Story Points

Description

Key events fire without key codes (understandable as you can 'swipe' whole words) and backspace fires no key[up|down|press] event at all.


Version: unspecified
Severity: major

Details

Reference
bz67262

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:34 AM
bzimport set Reference to bz67262.

There is an 'input' event which fires, but this doesn't solve the problem of prevent the default backspace behaviour.

See https://code.google.com/p/chromium/issues/detail?id=118639 for pitchfork waving, including a complaint from the Microsoft Office Web Apps team who are having the same problem.

Not quite true, see http://jsbin.com/alAKaNaZ/5

Backspace fires a keydown with keyCode 0 (same as every other key event) but not when whitespace is deleted.

See https://code.google.com/p/chromium/issues/detail?id=184812

"No key event is generated when the BACKSPACE key is pressed outside of composition, in other words, when AdapterInputConnection.deleteSurroundingText is called. In the reported bug, since the text field is empty, thus IME is not in the composition mode, thus pressing the BACKSPACE key triggers deleteSurroundingText and thus no key event is generated.

A cl that generates key events in deleteSurroundingText with a dummy keycode is under review at https://codereview.chromium.org/348413003/."

It looks like the above commit to Chrome for Mobile has been merged, which solves the most serious case (no event fired at all). We are still left with the general problem of IME deletion.

(In reply to Ed Sanders from comment #6)

It looks like the above commit to Chrome for Mobile has been merged, which
solves the most serious case (no event fired at all).

It doesn't "solve" it perfectly, as OS update lag for Android devices is notoriously slow (or non existent), and app update take-up is apparently poor. Is there a sane work-around we could do?

We are still left with the general problem of IME deletion.

Yeah. :-(

OS update is not an issue, just app.

brion added a comment.Jul 3 2014, 3:16 PM

Note that Android 4.4's WebView is based on the Chromium engine, and unlike the standalone Chrome app it only gets updated with the OS. Might want to check whether the stock Android browser on non-Google-branded 4.4.x devices is also affected. (Nexus devices seem to leave out the AOSP default browser in favor of Chrome, but I see a customized version on Samsung Galaxy branded devices for instance.)

Jdforrester-WMF lowered the priority of this task from High to Low.Jan 9 2015, 10:33 PM
Jdforrester-WMF set Security to None.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 21 2015, 6:19 PM
Jdforrester-WMF removed dchan as the assignee of this task.Nov 19 2015, 7:06 PM

Looks like on latest Chrobile/iOSafari we get input+beforeinput events with an inputType of 'deleteContentBackward'. This should be enough to fix this (assuming we can preventDefault).

There is a still bug where no events are fired if the cursor is in an empty span, and deleting across a paragraph.