Closed evans closed 6 years ago
Thank you for looking at this, @evans! I think this does partially solve some instances of this problem, however even with this change, it appears that the search is still off the page when arriving to a sub-section anchor link, as seen in this Netlify preview of this PR (which I believe is working properly — you're the first PR to really test this implementation though!):
It's possible that in order to accomplish this we might need to anchor the title and the search box and have the scrollable <div ... >
content below them. Thoughts?
To clarify, I'm suggesting that this should be pinned:
@abernix That makes total sense to pin it to the top of the sidebar. I'll try to take a look at it and see if my knowledge of html is proficient 💪
For doc sites such as Apollo Link, the sidebar scroll hides the searchbox, since the
location.pathname
is/docs/link/
rather than/
. The new calculation also works on the meteor docs, at least in the console 😜.document.querySelectorAll('.item-toc a.sidebar-link')[0] === document.querySelector('.item-toc a[href=""]')
for your convenience