Page MenuHomePhabricator

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


Edit the lede section on

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


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

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

It doesn't affect all pages, e.g. 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

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.