Android: Using virtual keyboard together with physical keyboard produces odd behavior |
|||
Issue descriptionChrome Version: 63.0.3233.0 (Official Build) canary (32-bit) OS: Android N What steps will reproduce the problem? (1) Set up an Android device with a physical keyboard. (2) Set Gboard as the active keyboard and enable showing the virtual keyboard while the physical keyboard is active. (3) Go to editpad.org and type a few letters on the physical keyboard, then hit enter on the physical keyboard. What is the expected result? The letters should remain after pressing enter. What happens instead? We delete the letters because the active composition range is on them. Note: does not repro in an Android EditText widget.
,
Nov 20 2017
Bisects to: https://chromium.googlesource.com/chromium/src/+/ef5c846a3e5d3c994d962ddca7d40f4bc1476044 Introduce InsertIncrementalTextCommand to respect existing style for composition In order to keep the previous text formatting when continuing typing on the word, confirming the ongoing composition, or inserting new text, this CL introduces InsertIncrementalTextCommand for insertion. The command detects what was there already, and restricts the write to the character(s) that actually changed. Note that this CL doesn't change the behavior of events, i.e., it still sends 'beforeinput', 'input', and 'textInput' events with the entire text. BUG= 620549 Review-Url: https://codereview.chromium.org/2530843003 Cr-Commit-Position: refs/heads/master@{#438490} I accidentally came up with a CL that fixes this while working on https://crbug.com/737395 . Seems to be related to how we update the selection after applying IME commands.
,
Nov 21 2017
I think the problem here is that for physical keyboard input, we should be replacing the selection instead of the composition range (I need to verify how this works for a native TextView though). My accidental "fix" is closing out typing (i.e. clearing the composition range) after setComposingText(), which is not the correct behavior.
,
Dec 1 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/812d7fc095e9093848a6207eaa635772a7bb52f4 commit 812d7fc095e9093848a6207eaa635772a7bb52f4 Author: Ryan Landay <rlanday@chromium.org> Date: Fri Dec 01 05:04:21 2017 Fix incorrect ending selection after InputMethodController::SetComposition() InputMethodController::SetComposition() works as follows: 1. The current composition range is selected (we don't show this to users). 2. The selection is replaced with the new text, which is left selected. 3. The resulting selection is converted to a composition range, and we change the selection to whatever the IME requested be selected afterwards. Step 2 causes the open TypingCommand's ending selection to be set to the resulting composition range. We need to update it after step 3 to fix two problems: 1. Pressing enter on a physical keyboard on Android with an open composition range causes the text in the composition range to be incorrectly deleted. 2. Pressing Ctrl-Z to undo causes each word to be selected in turn (see video on https://crbug.com/787598). There's another problem with undo on Android, which is that the TypingCommand is closed out after every call to SetComposition() when we select the composition, which means undo only undoes one character at a time. I might fix this in a separate CL. Bug: 787598, 772565 , 772584 Change-Id: I29f09e3c0bd97c6c8e17e5455c5579b53aa34c1b Reviewed-on: https://chromium-review.googlesource.com/783770 Commit-Queue: Ryan Landay <rlanday@chromium.org> Reviewed-by: Changwan Ryu <changwan@chromium.org> Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org> Reviewed-by: Yoshifumi Inoue <yosin@chromium.org> Cr-Commit-Position: refs/heads/master@{#520857} [modify] https://crrev.com/812d7fc095e9093848a6207eaa635772a7bb52f4/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java [modify] https://crrev.com/812d7fc095e9093848a6207eaa635772a7bb52f4/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java [modify] https://crrev.com/812d7fc095e9093848a6207eaa635772a7bb52f4/third_party/WebKit/Source/core/editing/commands/TypingCommand.h [modify] https://crrev.com/812d7fc095e9093848a6207eaa635772a7bb52f4/third_party/WebKit/Source/core/editing/ime/InputMethodController.cpp [modify] https://crrev.com/812d7fc095e9093848a6207eaa635772a7bb52f4/third_party/WebKit/Source/core/editing/ime/InputMethodControllerTest.cpp
,
Dec 1 2017
Will be fixed in M65
,
Dec 1 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by rlanday@chromium.org
, Oct 7 2017