Page MenuHomePhabricator

Going to an #Anchor link, viewport jumps back to top of page (all wikis, all skins)
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

  • Scroll jumps to correct section, then jumps back to top

What should have happened instead?:

  • Scroll jumps to correct section and stays

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

  • Tested on vector, vector-2022, monobook, Timeless, Cologne Blue, Minerva (web), Modern

Event Timeline

From my own testing using Firefox 103.0.2, Chrome 104.0.5112.102, and Edge 104.0.1293.54 on Windows 10, it appears as though the page is initially loading and locating correctly to the anchor link, and then once page load completes the browser jumps back to the top of the page.

Did some more testing, seems to be JavaScript related, as disabling all scripts via NoScript results in the expected behaviour. Unfortunately I can't dig any deeper to find a culprit script, as I've not done any webdev in a hot minute and my skills are a bit rusty. However as it seems to be occurring in safemode, it suggests that its one of the scripts that come from MediaWiki core and not a userscript.

Reedy triaged this task as Unbreak Now! priority.Aug 18 2022, 10:19 PM
Aklapper renamed this task from #Anchors in links appear to be broken on all wikis, all skins to Going to an #Anchor link, viewport jumps back to top of page (all wikis, all skins).Aug 18 2022, 10:23 PM
Aklapper lowered the priority of this task from Unbreak Now! to Needs Triage.
Aklapper triaged this task as Unbreak Now! priority.
Aklapper added a project: Regression.

Mentioned in SAL (#wikimedia-operations) [2022-08-18T22:25:44Z] <dancy> Rolling the train back to group1 due to T315620

The issue appears to be fixed in production.

Was the fix https://gerrit.wikimedia.org/r/c/mediawiki/core/+/824573 or something else?

If the fix was 824573, we may want to revert https://gerrit.wikimedia.org/r/c/mediawiki/core/+/822328/. We've only reverted the backport so far I think. Reverting 822328 would take care of reverting the master branch.

Change 824435 had a related patch set uploaded (by Legoktm; author: Legoktm):

[mediawiki/core@master] Revert "Set initial-zoom via JavaScript to avoid font-scaling issue in iPad"

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

Change 824435 merged by jenkins-bot:

[mediawiki/core@master] Revert "Set initial-zoom via JavaScript to avoid font-scaling issue in iPad"

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

Legoktm claimed this task.

Reverted out of master now too. Thanks @dancy for fixing production. Presumably future discussion of this issue can take place on the original task, T311795: [Bug] Safari doesn't allow font-size scaling on iPad for users viewing legacy and modern Vector.

Change 824437 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] Set initial-zoom via JavaScript to avoid font-scaling issue in iPad (take 2)

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

Test wiki created on Patch demo by Jdlrobson using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/3778e08640/w

Test wiki on Patch demo by Jdlrobson using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/3778e08640/w/