Closed Bug 1639071 Opened 8 months ago Closed 8 months ago

Duplicated Doubled Text Input with Digit Keyboard

Categories

(GeckoView :: General, defect, P1)

Unspecified
All

Tracking

(firefox78 fixed)

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: ekager, Assigned: m_kato)

Details

(Whiteboard: [geckoview:m78][geckoview:m79])

Attachments

(2 files)

Attached video credit.mp4

STR:

  1. Go to https://nidooakland.square.site/s/order
  2. Add item to cart, go to checkout
  3. Add fake name info and get to payment section
  4. Start typing credit card info

Expected:
Single digit entered per tap

Actual:
Digits duplicated - 2 per tap (see video), back spacing removes the extra

Device:
Pixel 3, Android Q

Could reproduce on GV 75 (current Fennec Beta) and on Fenix Nightly
Could not reproduce on Chrome or Fennec Release

Similar to https://bugzilla.mozilla.org/show_bug.cgi?id=1470786 and https://bugzilla.mozilla.org/show_bug.cgi?id=1569007 but can personally only reproduce with digit keyboard.

Some Fenix users are still reporting it for non digit keyboard https://github.com/mozilla-mobile/fenix/issues/4208#issuecomment-626725098

Flags: needinfo?(m_kato)

I look this.

Assignee: nobody → m_kato
Flags: needinfo?(m_kato)

Similar to https://bugzilla.mozilla.org/show_bug.cgi?id=1470786 and https://bugzilla.mozilla.org/show_bug.cgi?id=1569007

This is another issue. But I don't know why this script inserts multiple character. I need investigate why. (I guess that selection change by setSelection may cause unfortunately input?)

nn.prototype.handleNumberInput=function(t,e) {
    e.preventDefault();
    var n=this.element.selectionStart,
    r=this.element.selectionEnd;
    if(!(this._state.value&&this._state.value.length>=this.maxLength()&&n===r)){
        var i=this._state.formattedValue.slice(0,n)+t+this._state.formattedValue.slice(r);
        this.setValue(i);
        var s=this.adjustedSelectionStart(n);
        this.element.setSelectionRange(s,s)
    }
},

Ah, this is GekcoEditable bug. we don't dispatch key press when key down event handler calls preventDefault. Fix is soon.

If key down event handler calls event.preventDefault(), web browser
shouldn't fire key press event. But GeckoView may fire key press
unfortunately if using software keyboard.

So we don't fire key press event when dispatching eKeyDown returns
nsEventStatus_eConsumeNoDefault.

Severity: -- → S2
Priority: -- → P1
Whiteboard: [geckoview:m78]
Whiteboard: [geckoview:m78] → [geckoview:m78][geckoview:m79]
Pushed by m_kato@ga2.so-net.ne.jp:
https://hg.mozilla.org/integration/autoland/rev/9d1e691341c3
Don't dispatch key press when key down handler calls preventDefault. r=geckoview-reviewers,esawin
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
You need to log in before you can comment on or make changes to this bug.