-
Notifications
You must be signed in to change notification settings - Fork 479
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
Make the navigation bar automatically scroll to the selected item #792
Conversation
Thanks! This would be great to have! My only concern is that it always hides the logo and the search box (you can scroll up, but you need to know that there's something there in the first place). Perhaps only the actual menu should scroll? A more involved version could then hide the the logo (but perhaps not the search) when the user starts scrolling down in the menu (like we do on mobiles with headroom). |
9bd88c1
to
21adfc0
Compare
It took a bit of CSS fiddling to get it to work, but now it always shows the logo and search. I could try to make scrolling the menu hide them, but I feel that it's more of a gimmick than a feature, and might be annoying to some. |
What do you think about subtracting Actually, alternatively, we wouldn't have to keep the logo and stuff fixed at all if we'd try to make sure that the gray box is symmetrically in the middle. "Home" is unlikely to be very tall, so it would keep the logo visible. Any thoughts? |
@mortenpi Sorry, I haven't looked at this in a while, but I tried subtracting the I think the least invasive compromise is probably to make just the search bar hover when scrolling down. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I took another look at this now and I think it looks great as is. The scrollbar on the right is actually more than enough to indicate that that there are menu items above.
Keeping the logo and search fixed is a good compromise I think. We can always improve on that in the future.
If it's good to go on your part I'll merge this soon.
Good to go! 😊 |
It seems that this broke the version selector (ref #855), which I missed since the local build didn't have a selector. Somehow the |
Oh, my local build also didn't have the selector. I can try and look into a fix. |
I am not sure if I made the change in the right place, but it works locally. If the navigation bar is really long (as in base), I find it slightly inconvenient that the navigation view jumps to the top when clicking a menu item. This PR shifts the navigation view to the current item at the end of the
document.ready
event call.