Page MenuHomePhabricator

Mobile section editing sometimes scrolls to the wrong place
Open, Needs TriagePublic

Description

Edit the lede section on https://en.m.wikipedia.org/wiki/Glee_(TV_series)

Observe that you are scrolled to the middle of the third paragraph, not the start of the first.

Details

Related Gerrit Patches:
mediawiki/extensions/MobileFrontend : mastermobile.editor.overlay: Fix scrolling to lead paragraph

Event Timeline

Esanders created this task.Sat, Nov 30, 7:39 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSat, Nov 30, 7:39 PM

This seems to affect all pages, e.g. also https://en.m.wikipedia.org/wiki/Ryan_Murphy_(writer).

I put a breakpoint in VisualEditorOverlay#scrollToLeadParagraph to see what is happening (this mangled code, blergh):

It looks like the page is already scrolled so that the lead paragraph is visible (at the bottom), while the code basically assumes that the page is scrolled to the top. Possibly the target changes in VE, or some random overlay change in MF, have caused the text selection to be already set and the cursor scrolled into view, while previously this wasn't happening?

I think this is a simple bug and we just need to replace $window.scrollTop( $window.scrollTop() + offset ); with $window.scrollTop( offset );. This is my own code and I don't know why I did it this way – must have been a hold-over from some earlier approach that just happened to work because $window.scrollTop() was always 0.

Change 553870 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/MobileFrontend@master] mobile.editor.overlay: Fix scrolling to lead paragraph

https://gerrit.wikimedia.org/r/553870

It doesn't affect all pages, e.g. https://en.m.wikipedia.org/wiki/The_Irishman_(2019_film) works fine.

Apparently that page has a valid cursor position before the infobox, because of the templates like "Use American English".

Change 553870 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] mobile.editor.overlay: Fix scrolling to lead paragraph

https://gerrit.wikimedia.org/r/553870

matmarex claimed this task.Tue, Dec 3, 12:47 PM
matmarex moved this task from Code review to QA on the VisualEditor (Current work) board.