[4.1.1] Issues with jumping to section headings: 1) Clicking the same TOC item more than once, 2) At page load (sometimes)
On VaultWiki.org's XF wiki demo site, jumping to a heading section fails in two different scenarios.
1) When clicking the same Table of Contents (TOC) item a second time. If a heading's anchor is already part of the current page's URL, nothing happens when clicking the TOC link associated with that same heading.
At the surface, changing this functionality might seem unnecessary. But imagine that someone has used the TOC to jump to a particular heading section. They then click XF2's floating 'return to top' button but decide that they want go back to the same section. They click the same TOC item as before and so they experience the issue. XF's 'return to top' button does not change what is written in the address bar, whereas clicking a TOC link does. It makes no difference whether they scroll up manually as the situation is the same.
2) Sometimes at page load despite the browser address bar having a matching anchor. With what seems to vary between device and/or browser, arriving at a wiki page with a initial anchor in the path (such as via a wiki link using the wiki="page|#section" bbcode) results in the desired section never being jumped to without further user action.
I can kind of reproduce this issue, but not reliably. For testing purposes, I have added two links to the page
Template:ParseBBCode (N.B. this is a reused old wiki page so the title is irrelevant). The two links point to the first and second headings on the Testing playground for XF2 page. What happens when you click through from either of these links?
On a Windows 10 desktop, with Mozilla Firefox link 1 failed to jump to the heading. Link 2 worked fine. On that same computer, with Google Chrome neither links 1 or 2 automatically jumped to the desired section the first few times I tested. Confusingly, I have repeated the test on a different day with this same computer and on that occasion link 2
did jump to the heading (but not link 1). Repeating a few more times one after the other, link 1 continued to not jump to the section.
Oddly enough, on an older PC running Windows 7, for Mozilla Firefox and Google Chrome they both correctly jump to the linked-to heading section

. Same success with Google Chrome on Android, albeit after a momentary delay.
Scratching my head with this one! Perhaps this is something that could benefit from other VW customers chiming in if they've experienced the above to try and identify similarities with device, OS and/or browser...
----
In an
earlier report I mentioned that a couple of my site's visitors were experiencing problems with TOC links not working. At the time I thought the most likely scenario was a scroll delay, but now I am not so sure. Here is my theory. Perhaps these visitors arrived at the destination wiki page via a link pointing to a precise section where for whatever reason the section did not ever automatically scroll into view (part 2 of this report). Subsequently they clicked on a TOC item for the same heading but that also failed to scroll (part 1 of this report).