You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I was adding the extra items in the sidebar nav for AI briefing, I realised that it's easy to miss the fact that the sidebar table of contents is expandable.
If you click in the table of text, on the text itself like clicking on "introduction", the browser will jump you straight to the element, similar to how anchor elements work, but it won't open details element, so you won't see the items 'inside' it:
If you click just outside the text then the details element will open, allowing you to see the other elements, like so:
I think previously this was what the addScrollBehaviourToLink() function did - it was designed to toggle the details element if a summary item containing a link was clicked, and then scroll to the place in the page, as opposed to either toggling OR jumping to the anchor part of the page. At this point, the details element is open, so jumping to sub-items is simple enough, and the scrollIntoView ought to have been slow enough for users to realise what just happened.
I don't think there is any javascript affecting the behaviour of sidebar items now - it appears to be commented out, and I think it might have been quite tightly coupled to the markup of the old theme template.
I don't have a local setup of the wordpress site, and I didn't want to spend time trying to debug it, but I think we might end up doing future reports with this type of template.
So, I'm creating this issue, as it took me a while to understand why the table of contents was acting the way it was, and I suspect I'll forgot by the time we look at it again.
The text was updated successfully, but these errors were encountered:
When I was adding the extra items in the sidebar nav for AI briefing, I realised that it's easy to miss the fact that the sidebar table of contents is expandable.
If you click in the table of text, on the text itself like clicking on "introduction", the browser will jump you straight to the element, similar to how anchor elements work, but it won't open details element, so you won't see the items 'inside' it:
If you click just outside the text then the details element will open, allowing you to see the other elements, like so:
I think previously this was what the
addScrollBehaviourToLink()
function did - it was designed to toggle the details element if a summary item containing a link was clicked, and then scroll to the place in the page, as opposed to either toggling OR jumping to the anchor part of the page. At this point, the details element is open, so jumping to sub-items is simple enough, and thescrollIntoView
ought to have been slow enough for users to realise what just happened.The code is below:
https://github.com/thegreenwebfoundation/tgwf-2020/blob/master/assets/js/theme.js#L44-L78
I don't think there is any javascript affecting the behaviour of sidebar items now - it appears to be commented out, and I think it might have been quite tightly coupled to the markup of the old theme template.
I don't have a local setup of the wordpress site, and I didn't want to spend time trying to debug it, but I think we might end up doing future reports with this type of template.
So, I'm creating this issue, as it took me a while to understand why the table of contents was acting the way it was, and I suspect I'll forgot by the time we look at it again.
The text was updated successfully, but these errors were encountered: