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.
Esanders | |
Nov 30 2019, 7:39 PM |
F31454315: image.png | |
Dec 2 2019, 6:31 PM |
F31453472: image.png | |
Dec 1 2019, 9:15 PM |
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.
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
mobile.editor.overlay: Fix scrolling to lead paragraph | mediawiki/extensions/MobileFrontend | master | +1 -1 |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | • matmarex | T239520 Mobile section editing sometimes scrolls to the wrong place | |||
Duplicate | None | T255131 Lede section edit broken on some pages |
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