Text editing in input and textarea occasionally loads previous input/next word/etc from some cache
Categories
(Firefox for Android Graveyard :: Keyboards and IME, defect, P2)
Tracking
(Webcompat Priority:revisit, firefox63 wontfix, firefox64 wontfix, firefox65 fix-optional, firefox66 affected)
Webcompat Priority | revisit |
Tracking | Status | |
---|---|---|
firefox63 | --- | wontfix |
firefox64 | --- | wontfix |
firefox65 | --- | fix-optional |
firefox66 | --- | affected |
People
(Reporter: tnm.spam, Assigned: denschub)
References
()
Details
(Whiteboard: [webcompat])
Comment 2•6 years ago
|
||
Comment 5•6 years ago
|
||
Comment 6•6 years ago
|
||
Comment 7•6 years ago
|
||
Updated•6 years ago
|
Assignee | ||
Comment 8•6 years ago
|
||
This site is broken in multiple ways. Just for the record, even in Chrome, the site is not fully working, but the character input validation there fails completely, allowing you to enter letters etc.
The site keeps a copy of the input's value to format it and then override the value whenever something has changed. This happens mainly on the keypress event. On entering a number in Firefox, keypress gets fired and the value is updated accordingly. On hitting backspace, the site is using a keydown handler to run a "remove one character and override the value" method. However, while we do dispatch keydown events, no key/keyCode is set, so the site ignores the event. That is, until the input is empty, at which point we dispatch a keydown event with keyCode=8, which the site recognizes and re-fills the field with the previous value minus one character, explaining why previous contents suddenly appear again.
Note that our backspace behavior is completely consistent with Chrome's. The key difference here is us dispatching keypress events on inputting numbers/letters, while Chrome is not.
Masayuki, I know we have a lot of special rules for Android input events, and I don't fully understand all of them; in fact, I don't think I understand Android input at all. :) Do you know why we dispatch a keypress event here, while Chrome is not?
Thanks for the deep analysis. Even if this webpage is broken, I only linked it as this (or similar) issue occurs with other (completely unrelated) pages as well.
I would also like to reiterate that Firefox Focus does not have this issue, not just Chrome.
May it be worth analizing what is different in behaviour between firefox for android and focus? I still have a feeling it is connected to saving form history, which focus obviously does not have.
Reporter | ||
Comment 10•6 years ago
|
||
I meant to write: " I only linked it as this (or similar) issue occurs with other (completely unrelated) pages as well, but here the issue was always reproduce-able, while other pages only rarely broke on this."
Comment 11•6 years ago
|
||
Well, our Android implementation must emulate Linux's behavior. That is, when IME inserts a committed character, using a keypress
event rather than using a set of composition events. On the other hand, Chrome does not use keypress
nor a set of composition events for this behavior. Instead, Chrome just dispatches beforeinput
, but we've not implemented it yet. So, it's currently impossible to behave exactly same as Chrome. So, this is really same issue of bug 1520983 (but not a dup).
If we'd use a set of composition events rather than a keypress
event, we can fix this bug only for the bank's app. However, I'm not sure it's safe for the other web apps. Current our behavior is compatible with our Desktop Firefox. I mean if web apps send desktop version to Firefox for Android, current behavior must work, but the "fixed" behavior may break it. (Note that I see 229 keyCode value (meaning "handled by IME") and "Unidentified" key value on Chrome even when Backspace key removes previous character on Chrome with GBoard (English). This is really odd behavior to me.)
On the other hand, when I connect Bluetooth keyboard to Android device, I see keypress
events even on Chrome, but looks like the bank's form work fine. So, dispatching keypress
event may not cause this bug.
(And I wonder, Safari on iOS works as similar to us or Chrome?)
Comment 12•6 years ago
|
||
And some notes (may not be related to this bug):
CtrlKeyDownHandler
does nothing ifwindow.event
isnull
orundefined
. ThenCtrlKeyHandler
(keypress
event handler) does similar things. However, we'll set it to non-null starting from 66.CtrlKeyHandler
checks UA a lot, but we don't hit any of them.CtrlKeyHandler
doesif (event.returnValue) event.returnValue = false;
. This will be same as callingevent.preventDefault()
starting from 66.CtrlKeyHandler
doesif (event.preventDefault) event.preventDefault = false;
, butevent.preventDefault
is a function...- Both
CtrlKeyDownHandler
andCtrlKeyHandler
returnfalse
and they are set toonkeydown
andonkeypress
. So that they don't need to touchevent.returnValue
andevent.preventDefault
...
Anyway, on Chrome, all keydown
and keyup
events have 229 for keyCode
. So, CtrlKeyDownHandler
nor CtrlKeyUpHandler
does nothing if you use GBoard and even when Backspace
but there is a character to delete.
Comment 13•6 years ago
|
||
(Perhaps, even if we change our behavior, when Firefox for Android is in PC site mode, we should keep current behavior because web apps for desktop browsers may not aware of composition events.)
Comment 14•6 years ago
|
||
Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.
Comment 15•6 years ago
|
||
See bug 1547409. Migrating whiteboard priority tags to program flags.
Updated•5 years ago
|
Comment 16•4 years ago
|
||
Updated•4 years ago
|
Description
•