Placing a cursor in a ContentEditable causes scroll position to be reset, rendering it almost unusable
Categories
(Core :: DOM: Selection, defect, P2)
Tracking
()
People
(Reporter: ejsanders, Unassigned)
References
Details
(Keywords: regression)
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36
Steps to reproduce:
Open a page with a ContentEditable area that is taller than the page, e.g. https://edg2s.github.io/content-editable-sandbox/ (fill in many lines of text in the right hand box, so there is more than one page of content), or open Wikipedia's VisualEditor before we deploy our workaround (https://gerrit.wikimedia.org/r/#/c/VisualEditor/VisualEditor/+/502851/).
Scroll down a bit and place your cursor.
Actual results:
The page scrolls back to the top of the contentEditable box.
This also happens every subsequent time you place the cursor, rendering the editor almost unusable.
Expected results:
The page should not scroll when placing a cursor (other than maybe to keep the cursor in view).
Bug 1490126 sounds suspiciously similar.
As that bug is marked a duplicate of a ticket that was resolved in 67.0a1, I tested this in beta & nightly, and it is still broken in 67.0b9 & 68.0a1.
Comment 3•5 years ago
|
||
Hello, thanks for your report.
I can confirm that your issue is reproducible using Nexus 9 (Android 7.1.1) and Huawei P9 Lite (Android 6).
Builds:
- Nightly 68.0a1 (2019-04-14);
- Beta 67.0b9;
- Release 66.0.2.
Notes:
- Not reproducible on Chrome.
Updated•5 years ago
|
Comment 4•5 years ago
|
||
Moving this to Core | Selection with the hope that is a better place for it to be triaged.
Comment 5•5 years ago
|
||
Resetting the priority to let it be on our normal triage radar.
Is this Android only issue? I didn't manage to reproduce it on Windows.
Updated•5 years ago
|
Comment 6•5 years ago
|
||
Emilio, could you please help me understand if Layout: Scrolling and Overfolow a better component for this? Thanks!
Comment 7•5 years ago
|
||
Maybe Ting-Yu is better at judging that. Ting-Yu, do you know of some android-specific code that could cause this?
It's likely that the right component is either Editor or Layout, but probably the first.
I indeed cannot reproduce this at all on Desktop.
Comment 8•5 years ago
|
||
I don't know anything related to that off the top of my head without further debugging. It looks like some kind of mechanism trying to scrolling the selection into the viewport. FWIW, the bug is still reproducible even if I turn off layout.accessiblecaret.enabled_on_touch
.
I'm going to cc masayuki and botond since they're likely to know more.
Comment 9•5 years ago
|
||
AFAIK, editor does not have Android specific code. Looks like that the scroll occurs after a while of changing selection/focus. APZC?
Comment 10•5 years ago
|
||
Even if I try to reproduce this with mouse on Android, I can reproduce this too. When I click with mouse, there are no touch events, nor accessible caret. Additionally, moving caret with arrow keys on VKB and swiping accessible caret does not cause this bug. So, somebody handles click and tap events specially on contentediable elements.
Comment 11•5 years ago
|
||
This is a regression.
Comment 12•5 years ago
|
||
This is the regression window I get:
Does anything from that window seem relevant? (We don't have inbound builds going back that far to get a more accurate window.)
Comment 13•5 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/946c1489acdddfd0f83fb790e9d082fcf4921b23 looks potentially related.
Comment 14•5 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #13)
https://hg.mozilla.org/mozilla-central/rev/946c1489acdddfd0f83fb790e9d082fcf4921b23 looks potentially related.
Thanks for the window.
Hey Randall, do you know what's up here? Thanks!
Comment 15•5 years ago
|
||
It's been a long time since I looked at this but that particular patch should just be changing the dispatcher used.
Updated•5 years ago
|
Comment 16•4 years ago
|
||
ejsanders, would you be able to re-test this with a recent Fenix release or nightly? I suspect it was fixed by bug 1622894.
Comment 18•4 years ago
|
||
Great, thanks for confirming! I'll close this as a dupe.
Description
•