Page MenuHomePhabricator

When you click a link for a specific article-section, you don't go to the proper spot.
Closed, DuplicatePublicBUG REPORT

Description

Apparently this bug was previously fixed. Someone speculated that maybe the new Wikipedia skin brought this old bug back.

See here:

Why is it that when I click here (https://en.wikipedia.org/wiki/Russo-Ukrainian_War#August_2014_Russian_invasion) then it doesn't bring me to the actual part where the black text says "August 2014 Russian invasion"? I've noticed this on a few occasions; it seems to go there at first but then "bump" downward for some odd reason. Curious what the problem might be and how to fix it so that it sends the person who clicks the link directly and neatly to the intended point in the article. Thanks so much!

...

As you surmised, something is indeed pushing the text down. We can see that the culprits are the collapsible sidebars at the top of the article below the infobox. The cause is that, when the page initially loads, these sidebars are fully expanded. Then, they get collapsed, causing the page layout to shift, and the autoscroll to the subsection which was initially correct looks like it goes off target.

I do remember this issue happening often in the past, but it was supposed to have been fixed in 2018. The comments in the bug explicitly mention collapsible elements as the cause. Something seems to have caused the issue to come back (perhaps the new skin?). It requires more debugging, but as in the original issue, is likely is a race condition between the page load and the collapsing, with the browser wanting to jump to an anchor as soon as it can render the page, but the CSS to collapse kicking in later.

Note also, when there are banners at the top of the page (I see one for Wiki Loves Folklore in Incognito), that has the same result.

I think the best way to get a fix would be to open a new bug report, referencing the old issue. You can file it on Phabricator. As long as you point to the previous issue, the devs should understand what's going on. Yes, once the issue is fixed, there will not need to be any changes to links. Also correct: if the anchor ever breaks (as they often do when sections get modified), the link would still work, but would not take you to any subsection.