-
Notifications
You must be signed in to change notification settings - Fork 913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Left-side menu / TOC jumps around after you click a menu #348
Comments
Hi |
Hi folks, do you have an example of this behaviour I can look at? I think my own sites and the examples I've looked at have sufficiently short TOCs that it's not happening. |
Also what size screen/device are you looking at the site on? |
You can see it on the Kubernetes site here https://kubernetes.io/docs/reference/access-authn-authz/ Click around the sub-levels of this page and you should see the topic you've clicked on be pushed off-screen. Using a 24in monitor running at 1920x1200 |
Aha! Finally managed to make it happen. Yes, that is weird. Will have a think about how we'd fix that - any ideas welcome. |
Here is my suggestion for scroll the menu to active menu item |
Added some tweaks for JS scrolling active menu item to center of nav element This version have also build in my suggestion for #450 and #449 |
I've made a first suggestion for #342. But I have noticed, that my JS to scroll doesnt't work within the version with a foldable sidebar menu. I have to take a further look once more. |
Any update on this issue? It looks like it's had some work done on it, but hasn't made it into a release? Would love to see this bug fixed, as it really affects the usability. |
Any news on this one? |
It seems that @narrenfrei's original patch doesn't apply to the current sidebar-tree.html, but with a slight reworking it seems to work:
|
Excellent! Robert would you mind submitting that fix as a PR and we can see it in preview/review? |
I wonder if we could take this opportunity to do some general improvements in this area? Issue #342 had some pointers and images of TOC that I thought looked a bit better. The TOC is often a big part of first impressions, since people use it to navigate, and a bit of improvement here could only help. |
Useful when the left-side toc is longer than the screen. Fixes google#348 and google#257 This is an update of the original patch of narrenfrei
Was this code change ever checked-in to Docsy? Looks like it was close to a fix, but the issue still persists and it's kind of a clunker. :-) |
No, unfortunately it didn't get merged |
Hey guys, First, add a file named <script >
(function() {
var a = document.querySelector("#td-section-nav");
addEventListener("beforeunload", function(b) {
localStorage.setItem("menu.scrollTop", a.scrollTop)
}), a.scrollTop = localStorage.getItem("menu.scrollTop")
})()
</script> It magically solved this issue and I'm happy now. |
@huanlin Worked like a charm, many thanks for the fix! Will you submit a PR so it can get included in the upstream docsy? I believe it would go into the layouts/partials/scripts.html file. |
Is this a bug? When you click on a menu link on the left / TOC section, the vertical scroll bar will jump around and vertically re-position the menu structure, often pushing the link that you've clicked on off-screen. You then need to scroll down to see the link you've click and view any sub-nodes it may have. It's super confusing and leads to a poor user experience.
Is this a bug, or perhaps there is a configuration setting that adjusts this?
Is anyone else experiencing this?
Thanks in advance.
The text was updated successfully, but these errors were encountered: