Closed Bug 1499076 Opened 6 years ago Closed 5 years ago

Wrong keyboard event order for backspace to delete selected text using GBoard

Categories

(GeckoView :: IME, defect, P3)

62 Branch
All
Android
defect

Tracking

(firefox67 wontfix, firefox67.0.1 wontfix, firefox68 wontfix, firefox75 fixed)

RESOLVED FIXED
mozilla75
Tracking Status
firefox67 --- wontfix
firefox67.0.1 --- wontfix
firefox68 --- wontfix
firefox75 --- fixed

People

(Reporter: info, Assigned: m_kato)

References

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0 Steps to reproduce: * On my HUAWEI VNS-L31 (Android 7.0), open Firefox and go to https://dvcs.w3.org/hg/d4e/raw-file/tip/key-event-test.html. * In the input field on that website, type "hello world" * Select the word "world". * On the soft keyboard (Huawei Swype), press the backspace key. Actual results: When the backspace key is pressed, the last 3 keyboard events listed in chronological order are: 1) input 2) keydown (keyCode 229) 3) keyup (keyCode 229) Expected results: According to https://w3c.github.io/uievents/#events-keyboard-event-order, these keyboard events are ordered incorrectly. The actual order should have been: 1) keydown (keyCode 229) 2) input 3) keyup (keyCode 229) Additionally, I noticed that just before the input event, there is also a selectionchange event, that modifies the current selection from "world" to a collapsed selection just after the "d". I would have expected the selection to have either remain unchanged, _or_ changed to where the cursor will end up after deletion (i.e., just after "hello "). This makes it very hard for rich text editors (Draft.js, Slate, and so on) who rely on javascript events to figure out what happened.
Environment: Device: Huawei Honor 8 (Android 7.0) Build: Nightly 65.0a1 (2018-11-28) Following your steps, the keyboard event order was: - keyup (keyCode 229), - keydown (keyCode 229), - input. So, I`m not sure exactly what you meant by chronological order. I`ve attached a screenshot with my result, please let us know if that is the result you got.
Flags: needinfo?(info)
As noted on https://dvcs.w3.org/hg/d4e/raw-file/tip/key-event-test.html: "The most recent event is at the top.", which means that the table lists the keyboard events in reverse chronological order (oldest at the bottom, newest at the top). Your screenshot is therefore exactly what I also get, and indicates that the events, sorted from oldest to newest, are: - input - keydown - keyup
Flags: needinfo?(info)
Priority: -- → P3
Summary: Wrong keyboard event order when using backspace to delete selected text → Wrong keyboard event order for backspace to delete selected text using Huawei Swype

Hi,

The issue is reproducible.

Environment
Device: Google Pixel C (Android 8.0.0)
Build: Firefox Nightly 68.0a1 (2019-05-08)

Regards,
Diana Rus

OS: Unspecified → Android
Hardware: Unspecified → ARM
Status: UNCONFIRMED → NEW
Ever confirmed: true

(In reply to Diana Rus from comment #3)

Hi,

The issue is reproducible.

Environment
Device: Google Pixel C (Android 7.0.0)
Build: Firefox Nightly 68.0a1 (2019-05-08)

Regards,
Diana Rus

Diana, is this result Huawei Swype? I don't have one and it is discontinued by Nuance.

Flags: needinfo?(diana.rus)

Hi,

The used device for testing was "Google Pixel C" with Android(8.0.0) and not Huawei. The user used device Huawei Honor 8. I have updated my comment with the correct android version used with the device.

Regards,
Diana

Flags: needinfo?(diana.rus) → needinfo?(m_kato)

(In reply to Diana Rus from comment #5)

The used device for testing was "Google Pixel C" with Android(8.0.0) and not Huawei. The user used device Huawei Honor 8. I have updated my comment with the correct android version used with the device.

Sorry for my question. What keyboard do you use on you Pixel C? Google GBoard?

Flags: needinfo?(m_kato) → needinfo?(diana.rus)

Hi,

No problem, yes.

Regards,
Diana

Flags: needinfo?(diana.rus)

Thanks, I can reproduce this with Gboard. I guess that this depends on precision feature of GBoard. It make composition, so it may create strange event.

Also, this occurs on GV (Reference Browser with GV 20190508)

Summary: Wrong keyboard event order for backspace to delete selected text using Huawei Swype → Wrong keyboard event order for backspace to delete selected text using GBoard
Blocks: 1609407
Component: Keyboards and IME → General
Product: Firefox for Android → GeckoView
Hardware: ARM → All
Version: Firefox 62 → 62 Branch
Assignee: nobody → m_kato
Status: NEW → ASSIGNED
Attachment #9130016 - Attachment description: Bug 1499076 - Add sendDummyKeyboardEvent test. r? → Bug 1499076 - Add SendIMEDummyKeyEvent test. r?
Pushed by m_kato@ga2.so-net.ne.jp: https://hg.mozilla.org/integration/autoland/rev/013a2d2e8770 Dispatch key down event before firing input event. r=geckoview-reviewers,snorp https://hg.mozilla.org/integration/autoland/rev/a2232c4a45b8 Add SendIMEDummyKeyEvent test. r=geckoview-reviewers,snorp
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75

Moving some keyboard bugs to the new GeckoView::IME component.

Component: General → IME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: